2
string1="start1.MATCH.ext"
string2="start2.qwer.ext"
string3="start3.MATCH.ext"
...
我要抓住每一個串並提取先內後外的部分,所以
MATCH.ext
qwer.ext
MATCH.ext
然後比較這些子串,以便我可以在if語句中做一些事情,如果他們匹配:
if (substr[i] == substr[j]) //now I can do something with string1 and string3
如何在Bash中做到這一點?由於
+1 - 優雅而簡單 – MatheusOl 2013-02-20 18:45:53
優秀的,謝謝 – JDS 2013-02-20 19:15:38