首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

shell中逐行处置文件

2012-08-03 
shell中逐行处理文件下面的代码展示了如何逐行处理文件?#!/bin/bashINFILE$1OUTFILE$2#empty out file$

shell中逐行处理文件

下面的代码展示了如何逐行处理文件

?

#!/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

热点排行