批量修改文件名:
for i in *.html; do mv $i ${i/oldstring/newstring}; done;
批量替换文件内容:
sed -i "s/oldstring/newstring/g" *.html
按行读数据,拆分,输出:
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
IFS='|' read -r -a items <<< "$line"
printf ",
(
'',
'',
'${items[0]}',
'',
'${items[1]}'
)"
done < "$1"