問sed的問題 - Linux

Table of Contents

※ 引述《allstarschh (allstars)》之銘言:
: 1. 想用sed來改某directory 下的所有檔案
: 不過不確定 find如何跟 sed使用
: 例如 說 dir/下 把每個檔名的最後一個字元刪掉
: 像
: find -type f -exec sed '/(.*).$/\1/g' {} \;

for i in $(find -type f); do
n=$(echo $i | sed 's/.$//')
echo mv $i $n
done


--

All Comments