sed usage
修改文件内容
sed -i '/pattern/s/old/new/g' <file> #先筛选出满足pattern的字符串, 然后将该字符串钟的old替换为new
修改多个文件名
for file in *.c # 列出需要修改文件名的文件
do
nfile=`echo $file | sed 's/file/ma/g'`
mv $file $nfile
done
---------------------------------------------
Study needs record, record needs review
---------------------------------------------