Using sed to find a folder directory in a file and replacing with another directory
So I am trying to use a simple sed command in shell to find and replace a certain string in my bash file for an alias.
The alias is something like:
alias configure='cd /opt/Test/conf/server'
I want to replace /opt/Test/conf/serv开发者_如何学运维er with /opt/Test/conf but am having difficulties with the syntax.
Thanks for any help.
cat my_bash_file.sh | sed 's#/opt/Test/conf/server#/opt/Test/conf#g'
精彩评论