如果我有这条线
sed -E 's/([^ ]*) ([^ ]*) ([^,]*), *([^,]*), *([^,]*), *([^.]*), *([^,]*) *([^,]), ([^ ]*) *([^,]) *([^,])/\2, \1, \3, ``\4," \\emph{\5} \\textbf{\8},{\9} (\6) /'
我想将它放入一个名为(Script.txt)的脚本中,我该如何操作,以便我可以对照file.txt运行它:
sed -f script.txt file.txt
答案 0 :(得分:1)
echo 's/([^ ]*) ([^ ]*) ([^,]*), *([^,]*), *([^,]*), *([^.]*), *([^,]*) *([^,]), ([^ ]*) *([^,]) *([^,])/\2, \1, \3, ``\4," \\emph{\5} \\textbf{\8},{\9} (\6) /' > script.txt
sed -E -f script.txt file.txt