aboutsummaryrefslogtreecommitdiff
path: root/helpers/bbcmd
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/bbcmd')
-rwxr-xr-xhelpers/bbcmd11
1 files changed, 11 insertions, 0 deletions
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