Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道如何在字符串中搜索和替换?比如说我有一个字符串
string=".blah http://google.com.ph/tabs/1.5.8 setup https://yahoo.com.ph/root/blah"
我想搜索版本1.5.8,然后将其替换为1.5.9. 我如何在 bash 中做到这一点?
1.5.8
1.5.9
instring="version 1.5.8" outstring=${instring//1.5.8/1.5.9}