开发者

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'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜