Skip to main content

All Questions

Tagged with
19 votes
7 answers
55k views

Cat command and echo

I'd like to concatenate the output from echo with content of a file. I've tried the following comand: echo "abc" | cat 1.txt > 2.txt but the 2.txt file only contains the content from 1.txt. Why ...
Ringger81's user avatar
  • 1,267
0 votes
1 answer
877 views

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

This works: echo "yada yada" | msmtp [email protected] but not this: cat yadayada.txt | msmtp [email protected] which delivers the email with empty content. Why does echo work through pipe but not cat ...
user19496's user avatar
  • 1,520
3 votes
1 answer
3k views

How to prepend contents of a file to another

This question relates to the already asked question How to add text to beginning of file The answer suggested by Dennis Williamson does the job: echo 'task goes here' | cat - todo.txt > temp &...
detraveller's user avatar