Tagged Questions
2
votes
1answer
200 views
Can I use pipe output as a shell script argument?
Suppose I have a bash shell script called Myscript.sh that need on argument as input.
But I want the content of the text file called text.txt to be that argument.
I have tried this but it does not ...
16
votes
6answers
969 views
What is the general consensus on “Useless use of cat”?
When I pipe multiple unix commands such as grep, sed, tr etc. I tend to specify the input file that is being processed using cat. So something like cat file | grep ... | awk ... | sed ... .
But ...
2
votes
3answers
5k views
Why does this not work? “ls *.txt | xargs cat > all.txt” (all files into single txt document)
Why does this not work?
ls *.txt | xargs cat > all.txt
(I want to join the contents of all text files into a single 'all.txt' file.)
find with -exec should also work, but I would really like to ...