将数字添加到管道命令行命令


0

我有一个产生一些数据的命令......

$./thing  
some
random
data

我希望能够执行

$./thing | somecoolcommand 

得到

1 some
2 random 
3 data

可以这样做吗?

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.