下面的代码展示了如何逐行处理文件
#!/bin/bash
INFILE=$1
OUTFILE=$2
#empty out file
>$OUTFILE
#redirection in file at the bottom
while read line; do
echo $line >> $OUTFILE
done < $INFILE
下面的代码展示了如何逐行处理文件
#!/bin/bash
INFILE=$1
OUTFILE=$2
#empty out file
>$OUTFILE
#redirection in file at the bottom
while read line; do
echo $line >> $OUTFILE
done < $INFILE