小技巧
for
用在for 循环中,如果list 变量里有空格,可以用IFS改变默认的空格分割
IFS=$'\012'
如果找到的文件名有空格,可以用
IFS=$'\012' for html_file in $(find $Data_dir -name "*" | grep -E "(*.html$)|(*.htm$)|(*.shtm$)|(*.shtml$)|(*.jsp$)" ) do echo "$html_file"
或者直接
find $Data_dir -name "*" -print0 | xargs -0 sed -i 's/string/XXXX/gi'
|
阅读(729) | 评论(1) | 转发(0) |