diff options
Diffstat (limited to 'cat-nonbackups')
-rwxr-xr-x | cat-nonbackups | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cat-nonbackups b/cat-nonbackups new file mode 100755 index 0000000..387cf7a --- /dev/null +++ b/cat-nonbackups @@ -0,0 +1,15 @@ +#!/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 +} +for file; do + if good_filename "$file" >/dev/null 2>/dev/null; then + cat -- "$file" + fi +done |