我想$var in
在 bash 中使用带有范围的 shell 括号扩展。简单地放置{$var1..$var2}
不起作用,所以我去了“横向”......
以下工作,但它有点笨拙。
# remove the split files
echo rm foo.{$ext0..$extN} rm-segments > rm-segments
source rm-segments
Run Code Online (Sandbox Code Playgroud)
有没有更“正常”的方式?
我需要在行或 URL 中替换一个单词,但我需要从命令行/终端进行。
我的意思是
$ ./myscript.sh xxx.xxx.xxx.xxx:8080/code -c code1 -t query
Run Code Online (Sandbox Code Playgroud)
现在从那里开始,无需返回,我需要替换code1
为mycode
或其他一些字符串。