m4rtin |
12-29-2009 04:48 AM |
bash script stdin accept values separated with new lines, commas, spaces
I have a script, where STDIN(numbers from a text file) is copied from a text file using mouse and pasted to the terminal window.
Code:
user@computer:~>./script -o -t <PASTE NUMBERS GOES HERE>
I mean the user should type ./script -o -t , then open this text file and copy particular numbers and paste those into the terminal window right after the ./script -o -t . The point is, that those numbers may be separated with space, with commas or with new lines:
Quote:
TEXT FILE EXAMPLE1:
----------
85 72 33423 2389 2312310
----------
TEXT FILE EXAMPLE2:
----------
23748923, 234723, 2, 0923, 1
----------
TEXT FILE EXAMPLE3:
----------
324
4
5
1231
18
----------
|
Is it possible to have a script, which is able to take input weather it's separated using commas, new lines or spaces?
|