aboutsummaryrefslogtreecommitdiffstats
path: root/cat-nonbackups
blob: 2031eaba3423c44a6d44e31f127172bdadd32e01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
set -e
good_filename () {
	test -n "$(printf '%s\n' "$1" | grep -v '~$' || :)" || return 1
	test -n "$(printf '%s\n' "$1" | grep -v '\.swo$' || :)" || return 1
	test -n "$(printf '%s\n' "$1" | grep -v '\.swp$' || :)" || return 1
	test -n "$(printf '%s\n' "$1" | grep -v '\.bak$' || :)" || return 1
	test -n "$(printf '%s\n' "$1" | grep -v '^\.#' || :)" || return 1
	test -n "$(printf '%s\n' "$1" | grep -v '^#' || :)" || return 1
}
if test "$1" = "--"; then
	shift 1
fi
for file; do
	if good_filename "$file" >/dev/null 2>/dev/null; then
		cat -- "$file"
	fi
done