Tuesday, May 12, 2020

How to create a new file in shell script with cat EOF

demo>cat test.sh
#!/bin/bash
rm -f temp_config

cat > temp_config <<-EOF
sfdfadfadfadf
dfadfadfad
[xxxx]
xfdfdf
EOF

cat temp_config
ls -lrt temp_config
demo>
demo>./test.sh
sfdfadfadfadf
dfadfadfad
[xxxx]
xfdfdf
-rw-r--r--  1 homenetwork  staff  39 May 12 14:52 temp_config
demo>

No comments:

Post a Comment

MarketAxess

MarketAxess: The Leader in e-Trading for Global Fixed Income MarketAxess Holdings Inc. (MarketAxess) is an international financial technol...