I created a simple shell script:
#!/bin/bash
clear
echo "Starting Script now....."
echo "Write the info below to a new file in same directory...."
echo "name: John Smith"
echo "email: [email protected]
echo "gender: M"
echo
echo
echo "File is done"
I want to create a file in the same directory with the Name, email, and gender details. I don't want to do it from the command line like this:
#./script.sh > my.config
I'd rather do it from within the file itself.
Heredoc.
cat > somefile << EOF
name: ...
...
EOF
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With