これは bash では非常に簡単なはずですが、なぜ苦労しているのかわかりません。私はbash初心者なので、優しくしてください。
擬似コード:
read a configuration file, extract the first line beginning with a key/value pair
in the format exec=/path/to/myprog -opt1 -opt2 $var1 $var2 ...
check that the /path/to/myprog is executable
if executable then
replace $var1, ... with the contents of the same bash variables in the script
check that all variables were replaced with existing bash variables
if aok
execute the command and be happy
else
complain echoing the partially-substituted command string
fi
else
complain echoing the un-substituted command string
fi
私が試したことは何もうまくいかないようです。私はいろいろなことを試すのに十分な時間を費やしてきました。提案、誰か?