0
我有一個非常奇怪的問題sed
,如果我做這個:SED無法處理用戶的〜/ .bash_profile中
[[email protected] ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' ~user/.bash_profile
它的罰款。但是,如果我嘗試以下方法:
[[email protected] ~]-> CONF_FILE="~user/.bash_profile"
[[email protected] ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' ${CONF_FILE}
sed: can't read ~user/.bash_profile: No such file or directory
也試圖引用變量:
[[email protected] ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' "${CONF_FILE}"
sed: can't read ~user/.bash_profile: No such file or directory
想不出哪裏出了問題,請指教。
殼牌的版本是3.2.25(1)-release
。
謝謝,這很快。 – leafei