【发布时间】:2016-01-31 15:08:25
【问题描述】:
我有几个文件:
test1.log
test2.log
test3.log
test.txt
test.txt 包含:
./test1.log
./test2.log
./test3.log
我希望能够使用我的:
test.txt
与
xargs -a test.txt ......
重命名
test1.log
test2.log
test3.log
到 .txt 文件:
test1.txt
test2.txt
test3.txt
有没有办法通过 rename、sed、sub 或 awk 做到这一点?
【问题讨论】:
-
rename 's/\.log\z/.txt/' $(cat test.txt) -
没用过,谢谢