I want to be able to write a script that can take stdout
as an argument, if anything is piped into it (ultimately, I would like it to be polymorphic) -
The trouble is, I have searched and searched for how to do this with no avail - lots of alternative suggestions about how to do other things that are not - this:
cat /var/log/some.log | grep something | awk '{print $1 $6 $8}' | myscript
Why do that, instead of? : myscript $(!!)
At this point, solely to prove that it is possible...
I know that you can 'read variable' in a script, but say I don't care about the lines - let's say, I want to accept the whole of it as a blob of text and do something with it in the script -
Do I really have to :
while read x; do
stdin=$stdin" "$x;
done;
solely in order to read from STDIN ?
There must be a better way ...