How do I pipe a list of numbers straight from the shell into a command?
- by learnvst
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.)