With this script I want to append a line of text to the /etc/hosts file. The script seems not to be working. What is wrong?
su
cd /etc
cat /home/rugile/file >> hosts
And /home/rugile/file looks like this:
127.0.0.1 domain.com
With this script I want to append a line of text to the /etc/hosts file. The script seems not to be working. What is wrong?
su
cd /etc
cat /home/rugile/file >> hosts
And /home/rugile/file looks like this:
127.0.0.1 domain.com
su
opens a new shell. You need to feed it the commands.
su << EOF
...
EOF