shell 读取文件
生活随笔
收集整理的這篇文章主要介紹了
shell 读取文件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
#!/bin/bash
content=`cat test.txt`
echo "begin"
for i in $content
doecho $i
done
?
讀取前10行
head -n 10 test.txt讀取后10行
tail -n 10 test.txt讀取第5行
sed -n "5,1p" test.txt讀取5到10行
sed -n “5,10p” test.txt?
轉載于:https://www.cnblogs.com/drizzlewithwind/p/6278644.html
總結
以上是生活随笔為你收集整理的shell 读取文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 51nod1092(lcs简单运用/dp
- 下一篇: 如何编译Apache Hadoop2.2