aboutsummaryrefslogtreecommitdiff
path: root/scripts/bbcmd
blob: fdc4e78927b878e537b67df7391cc3cdc828cbb8 (plain)
1
2
3
4
5
6
7
8
9
10
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