使用此脚本,我想在/etc/hosts 文件中附加一行文本。该脚本似乎无法正常工作。怎么了?
su
cd /etc
cat /home/rugile/file >> hosts
/home/rugile/file 看起来像这样:
127.0.0.1 domain.com
最佳答案
su
打开一个新的 shell 。您需要向它提供命令。
su << EOF
...
EOF
关于shell - Ubuntu shell 脚本不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10643044/