I needed to write a script to enter multi-line input to a program (psql
).
After a bit of googling, I found the following syntax works:
c
This isn't necessarily an answer to the original question, but a sharing of some results from my own testing. This:
< print.sh
#!/bin/bash
echo \$PWD
echo $PWD
test
will produce the same file as:
cat < print.sh
#!/bin/bash
echo \$PWD
echo $PWD
test
So, I don't see the point of using the cat command.