This question already has an answer here:
- How to print “$” in here-document 4 answers
I am having trouble with writing
case $1 in a bash file. I tried with
cat <<EOT > /etc/init.d/startup.sh #!/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin case "$1" in start) bash /root/install.sh >> /root/installation_log.txt 2>&1 ;; stop|restart|reload) ;; esac EOT
But the problem is it writes everything to
case "$1" in
case "" in
after the operation.
What to do?