执行 shell 脚本时,输入字符串类似于:
test1/test2/Test.jar/Test2.jar/com/test/ui/GI.class
我如何提取: test1/test2/Test.jar[即子字符串直到第一次出现'.jar'分隔符,包括],在shell脚本中
test1/test2/Test.jar
我怎样才能做到这一点?我不想使用 cut 然后在末尾附加“.jar”。
谢谢
command-line bash scripts text-processing
bash ×1
command-line ×1
scripts ×1
text-processing ×1