Hi -
I am trying to do a simple config file with known variable names in it, e.g.:
contents of config file a.conf:
-a
-b $work
-c $host
simplified contents of bash script file:
work='trunk'
host='alaska'
opts=$(tr '\n' ' ' < a.conf)
opts="$opts $*"
mycommand $opts arg1 arg2
The goal is to get the script to execute:
mycommand -a -b trunk -c alaska arg1 arg2
But no matter what I try, it always comes out:
mycommand -a -b $work -c $host arg1 arg2
I have tried various quoting methods and evals, but no go.
Can anyone suggest the proper syntax for this?
Note: this is a highly simplified example so I would rather not have to do some kind of sed/awk substitution on the config file contents.