I've got a scenario where I have command < filename.txt
so I can pass the contents of filename.txt
and use it in command
. But say I want to take the contents out of the file and just use them in one command line action. How would it look?
Say the contents of filename.txt
are as follows:
To: me@domain.com
Message: Some message
I've tried stuff like command "To: me@domain.com\n Message: Some message"
with no luck. How do the contents of a text file look when they get parsed into a command in that way?
command
wants a newline. You could add a "\n" at the end of the printf command and I'll bet it would work. :) – dannysauer Oct 13 '16 at 18:25