[問題] Shell script 問題

看板Linux作者 (gecer)時間8年前 (2017/12/09 13:59), 編輯推噓2(205)
留言7則, 5人參與, 8年前最新討論串1/1
小弟下載 ultraeditor on red hat 5.8 (https://www.ultraedit.com/downloads/uex.html) 因開啟ultraeditor 需用root權限 故撰寫一份shell script 自動sudo -s 後開啟 ultraeditor 內容如下 https://imgur.com/a/ES3ZK 但是執行時卻直接跳回shell konsole https://imgur.com/a/nY3KX 反而要在shell konsole 先執行sudo -s後 再執行 script #!/bin/bash cd ..../uex/bin ./uex 才會開啟 小弟已確認該linux server的sudo -s 不需密碼 請問sudo -s 不能寫在shell script嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 122.121.28.242 ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1512799185.A.E9F.html

12/09 14:12, 8年前 , 1F
sudo -s 會開一個新的 shell 於是下面兩行都沒有執行到
12/09 14:12, 1F

12/09 14:12, 8年前 , 2F
不過為什麼開啟這個軟體會需要 root 權限?
12/09 14:12, 2F

12/09 14:50, 8年前 , 3F
sudo好像是ubuntu在用,CentOS不需要...好像。
12/09 14:50, 3F

12/09 14:51, 8年前 , 4F
CentOS就是 redhat。
12/09 14:51, 4F

12/09 15:04, 8年前 , 5F
這篇怎沒用英文問 XD
12/09 15:04, 5F

12/09 16:25, 8年前 , 6F
是要直接用 sudo 後面接你要執行的命令
12/09 16:25, 6F

12/09 16:33, 8年前 , 7F
sudo ..../uex/bin/uex 就好,sudo 後是直接執行
12/09 16:33, 7F
文章代碼(AID): #1QAtlHwV (Linux)
文章代碼(AID): #1QAtlHwV (Linux)