Monday, September 24, 2012

Using EOF in the shell script.

bash-3.00$ more eof.sh
#!/bin/bash
price=2000
cat  << EOF
John said, As he looked over the amount, He'd say
the price of $price is okay and  He'll give \$1000 to begin with.
EOF
echo
echo "I have \$400 in the bank."
echo

Lets run the script

bash-3.00$ ./eof.sh
John said, As he look over the amount, He'd say
the price of 2000 is right and  He'll give $1000 to start.
I have $400 in the bank.
bash-3.00$

No comments:

Post a Comment