Rather than taking the string as a command line argument, you may simply use cat to read the script's standard input:
printf '%s\n' "$foo"
if [ "$bar" = "-" ]; then
# assume data is on standard input
cat
else
print '%s\n' "$bar"
fi
Rather than taking the string as a command line argument, you may simply use cat to read the script's standard input:
printf '%s\n' "$foo"
if [ "$bar" = "-" ]; then
# assume data is on standard input
cat
else
print '%s\n' "$bar"
fi