Read file line by line (Bash shell script, sed usage)
2012-02-06 10:57
411 查看
#!/bin/sh filename=aaa num=`cat $filename |wc -l` echo $num i=1 while [ $i -le $num ] ; do line=`sed -n "$i,$i p" $filename` echo $line i=$(($i+1)) done
相关文章推荐
- Shell Script Utility To Read a File Line By Line
- Bash Shell read file line by line and substring
- read line from file with bash shell script
- read file by bash shell just as getline() in c++
- Expect script to read file line by line
- bash read file line by line
- ubuntu shell脚本line 1: #!/bin/bash: No such file or directory
- Open and read file line by line tcl tk
- Java 8 Stream – Read a file line by line
- 关于while read line循环的linux bash shell bug
- [shell]while read line do done < file
- How to read a file line by line?
- Golang Read File line by line
- Read in text file line by line php - newline not being detected
- How to read file line by line?
- bash shell script取得当前脚本的路径
- read file in a single line
- shell脚本报错 -bash: ./mysql.sh: /bin/bash^M: bad interpreter: No such file or directory
- -bash: ./my_script: /bin/bash^M: bad interpreter: No such file or directory