Bash: How to concatenate the output of different commands?
I want to concatenate the output of an echo and a grep command, and pipe them to smbclient, which shall send them as a message.
I tried: echo "sometext" ; grep searchstring /path/to/file | smbclient -M addressee The above command printed "sometext" onto the screen, and only piped the output of the grep command to smbclient to send it as a message. Also, I want to put a newline in the message between the output of the echo and grep commands. (Naturally, newlines in the output of the grep command should also be kept) Anyone knoing how to do this? |
(echo -e "blah\n"; grep something) | smbclient....
should do you fine, i can never get newline's in echo right though... so don't quote me on that bit. |
All times are GMT -5. The time now is 10:49 AM. |