diff options
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/posix-defuns.sh | 14 |
1 files changed, 13 insertions, 1 deletions
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 <spwhitton@spwhitton.name> # @@ -15,6 +15,18 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +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= |