I have a pretty strange problem with sed
, if I do with this:
[root@Camel ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' ~user/.bash_profile
it's fine. But if I try the following:
[root@Camel ~]-> CONF_FILE="~user/.bash_profile"
[root@Camel ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' ${CONF_FILE}
sed: can't read ~user/.bash_profile: No such file or directory
also tried to quote the variable:
[root@Camel ~]-> sed -i 's/TLRAGENT_IP=.*/TLRAGENT_IP='"${HOST_IP}"'/' "${CONF_FILE}"
sed: can't read ~user/.bash_profile: No such file or directory
couldn't figure out where went wrong, please advise.
Shell's version is 3.2.25(1)-release
.