From 27bfaa1f9ca6f1c097d0d38190f63d50e21bc801 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 23 Jan 2023 08:17:06 -0700 Subject: hstow: move a few other things out to posix-defuns.sh --- lib-src/posix-defuns.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib-src') diff --git a/lib-src/posix-defuns.sh b/lib-src/posix-defuns.sh index edacea49..a347fa1e 100644 --- a/lib-src/posix-defuns.sh +++ b/lib-src/posix-defuns.sh @@ -1,4 +1,4 @@ -# POSIX sh-compatible shell functions +# POSIX sh-compatible shell definitions # # Copyright (C) 2021, 2023 Sean Whitton # @@ -15,6 +15,18 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +tab="$(printf '\t')" +cchars="$(printf '*[\001-\037\177]*')" + +fail () { + echo >&2 "${0##*/}: $*" + exit 127 +} + +dir_contents () { + ( cd "$1"; find . ! -name . ! -name "$cchars" -print -prune ) +} + # Copied from src/connection.lisp in Consfigurator, which see for commentary. mkstemp () { local template="${1:-${TMPDIR:-/tmp}/tmp.XXXXXX}" err= -- cgit v1.2.3