低于 ism y 代碼
if [ ip add show tun0 2>/dev/null ] ; then
export http_proxy="http://127.0.0.1:2123"
fi
但是當我在連接后做回聲時
echo $http_proxy
它沒有顯示。可以指教嗎?
uj5u.com熱心網友回復:
@GordonDavisson 建議:
if ip add show tun0 2>/dev/null
then
export http_proxy='http://127.0.0.1:2123'
fi
但你也可以這樣寫:
ip add show tun0 2>/dev/null && export http_proxy='http://127.0.0.1:2123'
ip成功時會在標準輸出上列印東西,所以也許你想這樣做>& /dev/null?與其丟棄所有資料,不如考慮將其存盤在一個變數中,然后您可以隨時在程式中添加一個詳細標志,以便在需要除錯時列印該變數的內容。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/474233.html
下一篇:遍歷csv并更改滿足條件的列的值
