Reputation: 437
I'm want to make my main batch file create another batch file. my main one is in a flash drive, i want it to make another batch file to eject it having it eject the main is easy, my problem is having the main create a brand new batch and dictate which commands go in it
Upvotes: 0
Views: 2104
Reputation: 2224
If you need multiple lines, you can use:
cat > newBashFile.sh << EOF
echo "first line"
echo "second line"
# multiple more commands, as long as they don't contain the string EOF
EOF
Another solution would be:
echo -e "first command\nsecond command\n..." > bashFile.sh
Upvotes: 1