zoukankan      html  css  js  c++  java
  • bash 学习笔记4

         文件的读取:

         可以通过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     取字符

  • 相关阅读:
    python中的time模块
    CSS 布局
    8 Function类型
    2 node 核心
    1 node 简介
    13 对象
    JS 算法一
    JS 模块化
    1 谈谈section标签
    JS 练习一
  • 原文地址:https://www.cnblogs.com/sidmeng/p/2363170.html
Copyright © 2011-2022 走看看