aboutsummaryrefslogblamecommitdiffstats
path: root/cat-nonbackups-with-head
blob: 426a50fe4c8e04cd91c31d211002eb5604c7d501 (plain) (tree)
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
		samedrun "$0" cat-with-head -- "$file"
	fi
done