How do I pipe a list of numbers straight from the shell into a command?

Posted by learnvst on Super User See other posts from Super User or by learnvst
Published on 2012-11-21T23:41:27Z Indexed on 2012/11/22 5:03 UTC
Read the original article Hit count: 538

Filed under:
|
|
|

How do I pipe a list of numbers straight from the shell into a command? For exampe something like this

[1,2,3,4] | sort

would give

1
2
3 
4

EDIT:

In response to the answers kindly posted so far . . . I ask this, because I want to quickly test and debug a console application that takes many numbers as it input without having to type lots of individual values followed by carriage returns. I'd like to just type in the 'one liner' and hit the up arrow now and then to replay the command. Ideally, I'd like to do this without using a text file containing the values (which would obviously be the most simple way to do this.)

© Super User or respective owner

Related posts about bash

Related posts about shell