How to get the second column from command output?

后端 未结 8 1176
有刺的猬
有刺的猬 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:31

    If you have GNU awk this is the solution you want:

    $ awk '{print $1}' FPAT='"[^"]+"' file
    "A B"
    "C"
    "D"
    

提交回复
热议问题