Sunday, January 29, 2017

Read from pipe and parameter in bash script

readfrompipeandarg.sh

x=$(cat);

echo "Parameters: $*";
echo "Piped: $x";

echo "topipe" | ./readfrompipeandarg.sh "as" "parameter"

No comments:

Blog Archive