> I like how GNU Parallel does its ::: magic ... > > Has anyone implemented something similar in pure bash?
My quick version of :::-like processing for bash looks like the following: declare -a cmd while [ $# -gt 0 ]; do [ "$1" = ":::" ] && break cmd+=("$1") shift done if [ "$1" = ":::" ]; then while shift && [ $# -gt 0 ]; do echo "${cmd[@]}" "$1" done else while read line; do echo "${cmd[@]}" "$line" done fi This breaks on multiple ::: and totally ignores ::::. An "...Only experts do this on purpose...." homage might go in that final else clause. - Rhys