Hi,
I would like to read the result from one command into my script using piped.
But I don't know what kind of argument to use.
Can anyone help me with this?
read piped info into a script
Re: read piped info into a script
I think piped info is just as standard input.
Something like this should work
Standard input get stored in variable MESSAGE
You can test the script with this
echo "this is a test" | script.sh
Something like this should work
Code: Select all
MESSAGE="$(< /dev/stdin)"
You can test the script with this
echo "this is a test" | script.sh