grep output into array

后端 未结 5 1323
清酒与你
清酒与你 2021-02-05 23:29

Guys How can I make this work

`find /xyz/abc/music/ |grep def`

I don\'t want to store the array in any temporary variable. How can w

5条回答
  •  滥情空心
    2021-02-06 00:23

    Put the call to find in array brackets

    X=( $(find /xyz/abc/music/ | grep def) )
    echo ${X[1]}
    echo ${X[2]}
    echo ${X[3]}
    echo ${X[4]}
    

提交回复
热议问题