Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


I'm attempting to use command substitution to keep command line arguments in a file. My initial thought was to simply place the command line arguments in a single line in a file and then call my command as command $( cat [arguments-file] ) other arguments However, this does not seem to be working for me correctly.

I started to do some debugging, turning on bash debug via set -x and the result of the command is

command $( /tmp/arg-file ) File.xml
+ command -m '"Manhattan' Item 'MockService"' -P 'Hellp=Value' File.xml

My argument file's contents are

-m "Manhattan Item MockService" -P Hellp=Value

Is anyone able to explain why the single quotes are being added during the command substitution?

share|improve this question
up vote 1 down vote accepted

They're not. The single quotes are only visible via set -x in order to disambiguate the words to the reader. However, storing command arguments like this is problematic at best. Consider storing one argument per line and using read and an array to generate the command line.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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