aboutsummaryrefslogtreecommitdiffstats
path: root/cat-nonbackups
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
committerMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
commit0f1df0db903ba576fd17b08197d3066af7a61e5f (patch)
treea59c04307b1382257afa3c3512ec3abadf7e0e47 /cat-nonbackups
parentUse losetup -d instead of --detach and add clean up (diff)
downloaddotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.gz
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.bz2
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.xz
A lot of changes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'cat-nonbackups')
-rwxr-xr-xcat-nonbackups15
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