本文共 563 字,大约阅读时间需要 1 分钟。
linux 多个参数 空格
How to cut by multiple spaces in ?
如何在减少多个空格?
For example, if I get a like
例如,如果我得到一个像
a b c d
where the spaces among the fields are not decided.
字段之间的空间不确定。
How to get the four fields a, b, c and d out?
如何获得四个字段a,b,c和d?
Here, we take getting ‘b’ (the 2nd field) as the example.
在这里,我们以“ b”(第二字段)为例。
You can first squeeze the repeated spaces by and then use as normal:
您可以先通过来压缩重复的空格,然后照常使用 :
tr -s ' ' | cut -d ' ' -f 2
Another way is to use directly:
另一种方法是直接使用 :
awk '{ $2}'
翻译自:
linux 多个参数 空格
转载地址:http://gmowd.baihongyu.com/