回答編集履歴
1
+correction
answer
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
カレントディレクトリ上のfoo_*.txtをリネームしつつサブディレクトリdestにコピーするという方針で考えてみました。
|
2
2
|
おそらくperlを使わずにこれ以上少ない文字数で実現することは出来ないでしょう。
|
3
3
|
```sh
|
4
|
-
ls foo_*.txt | perl -nle '$a=$_; s#(foo_)(\d+)(.txt)#"dest/$1".($2+1).$3#e; print "
|
4
|
+
ls foo_*.txt | perl -nle '$a=$_; s#(foo_)(\d+)(.txt)#"dest/$1".($2+1).$3#e; print "cp $a $_"' |sh
|
5
5
|
```
|