This question already has an answer here:

I'm trying to run an expect script that runs a telnet session to automate the sending of an email, I'm trying to pass the contents of a file as a single argument to my script but when the backticks are interpreted the white space in that file are causing multiple arguments to be passed.

Here's my command...

runTelnet `cat test_results.txt`

Is there a way to quote the output of a backtick expression?

marked as duplicate by Gilles, sam, Kusalananda, lcd047, G-Man Jul 20 '16 at 8:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



runTelnet "$(cat test_results.txt)"


runTelnet "`cat test_results.txt`"

Enclosing the backticks in quotes will cause the results of the command to be passed to runTelnet as a single argument.

Not the answer you're looking for? Browse other questions tagged or ask your own question.