danbarrese
9/1/2016 - 4:40 AM

capture stdout from another process and use it as input for this script, pipe & filter

capture stdout from another process and use it as input for this script, pipe & filter

stdin=
if [ -t 0 ]; then
    if [ $# -gt 0 ]; then
        stdin=$@
    fi
else
    # how to preserve color?
    stdin=$(cat "-")
fi