From 865092c656af70bd5317513d8e0ed87fdc1c9acd Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 24 Feb 2020 01:31:39 -0800 Subject: Major update: instead of defining all the helper functions as static C-strings prefixed to commands (modified by the Makefile), the helper functions are now standalone scripts in the helpers/ dir, which gets added to "$PATH" when running bb. --- helpers/bbcmd | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 helpers/bbcmd (limited to 'helpers/bbcmd') diff --git a/helpers/bbcmd b/helpers/bbcmd new file mode 100755 index 0000000..fdc4e78 --- /dev/null +++ b/helpers/bbcmd @@ -0,0 +1,11 @@ +#!/bin/sh +if [ $# -eq 0 ]; then cat >> $BBCMD; exit; fi +for arg; do + shift + if expr "$arg" : '^[^:]*:$' >/dev/null; then + if [ $# -gt 0 ]; then printf "$arg%s\\0" "$@" >> $BBCMD + else sed "s/\([^\\x00]\+\)/$arg\1/g" >> $BBCMD; fi + exit + fi + printf "%s\\0" "$arg" >> $BBCMD +done -- cgit v1.2.3