文件的读取:

     可以通过descriptor来进行读取

     如:

exec 3<orders.txt
exec 4>log.out
while read LINE <&3 ; do
printf “%s\n” “$LINE” >&4
done

    descriptor从3开始,0是标准输入,1是标注输出,2是标准错误输出。

    descriptor的位置可以在/dev/fd中搞到。

    当然也可以通过如下方式来读取文件:

while read LINE  ; do
printf “%s\n” “$LINE” >&4
done<log.out

 

   cut的用法:

   cut -d ' ' -f 2     其中-d后面是分界符,-f后面是要取得的field

   cut -c 1-4     取字符

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2021-07-25
  • 2021-08-04
  • 2022-01-06
  • 2021-06-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案