I'm trying to run a program with each of my script's arguments passed as a different line on stdin. My current attempt involves using a for
loop, as follows:
#!/bin/bash
[My Program] <<EOF
for i in "$@"
do
$i
done
EOF
This doesn't work -- the program actually receives for i in
as part of its input, instead of being given the list of arguments themselves. How would I change it to function?