From 0f1df0db903ba576fd17b08197d3066af7a61e5f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 18 Nov 2023 23:23:40 +0100 Subject: A lot of changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- cat-nonbackups | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 cat-nonbackups (limited to 'cat-nonbackups') 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 -- cgit v1.2.3-70-g09d2