我有一个脚本,我用过#34; sudo -s"执行此脚本时,我注意到一些非常奇怪的行为。为了解决这个问题,我决定在以下脚本中重新创建问题。我注意到" sudo -s"只执行一次。完全崩溃后不久。为了让它发挥作用,我需要做些什么特别的事情吗?
1 #! /bin/sh
2
3 echo "test"
4 echo "the script is working"
5
6 sudo -s
7
8 echo "reading script after first sudo"
9 sudo -s
10 echo " reading script after second sudo"
11
12 echo "the script is still working"
13 echo " still working"
...结果
./btest
test
the script is working
#
!!!note script stops here. first sudo worked!!!!