0
votes
1answer
171 views

Why does echo work through pipe but not cat with msmtp?

This works: echo "yada yada" | msmtp my@mail.com but not this: cat yadayada.txt | msmtp my@mail.com which delivers the email with empty content. Why does echo work through pipe but not ...
2
votes
3answers
2k 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 ...
21
votes
6answers
2k 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 ...
4
votes
3answers
8k 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 ...