How to get the second column from command output?

后端 未结 8 1180
有刺的猬
有刺的猬 2020-11-29 18:08

My command\'s output is something like:

1540 \"A B\"
   6 \"C\"
 119 \"D\"

The first column is always a number, followed by a space, then a

8条回答
  •  没有蜡笔的小新
    2020-11-29 18:24

    You don't need awk for that. Using read in Bash shell should be enough, e.g.

    some_command | while read c1 c2; do echo $c2; done
    

    or:

    while read c1 c2; do echo $c2; done < in.txt
    

提交回复
热议问题