魚殼如何檢查根 2024-7-17 • fish 有沒有辦法使用fish shell斷言目前「使用者」是root(即腳本由root執行)? 我知道對於 bash 你可以檢查歐盟用戶識別碼 答案1 光靠魚是做不到的。我會寫: if test (id -u) -eq 0 echo root else echo not root end 相關內容