Reading input piped to a bash script
Can anyone explain how I can read input to a bash script through a pipe?
I want to be able to receive input both through a pipe, and through
parameters to the script. For example:
echo "blabla" | myscript.sh
The script should be able to check whether or not any input is coming
through the pipe, and if not use $1. I have tried with cat and read but
they always asks the user interactively if nothing is piped to the