Trying to pipe multiple strings into a file similar to the following:
#!/bin/sh
echo "First name: ";
read ANSWER1;
echo "Last name: ";
read ANSWER2;
echo $ANSWER1 ANSWER2;
Wanting to be able to pipe in values like or similar (I don't want to be updating the sh script) and get the following result:
$ echo "Bugs"; echo "Bunny" | scriptName
Bugs Bunny
For multiline input, use a heredoc instead of multiple echo
s:
cat << EOF | scriptName
Bugs
Bunny
EOF