I am trying to pass a config file asan argument from the command line to a script and not getting the expected results.
Thank you :).
config called on command line as:
bash script.sh /path/to/config.txt
contents of /path/to/config.txt
#File1comment
var1=/path/to/file1
#File2comment
var2=/path/to/file2
contents of script.sh
config=$1
. $config
echo -e "$@"
test -n "$1" && set -- a b c
current
/path/to/config.txt
desired --- each file avaliable to script ---
/path/to/file2
/path/to/file2
new code
config=$1
set -- $config
echo -e "$@"
while read line; do
printf "$line" >script.sh
done <"$config"
$var1and$var2in your script?printfafter thesetto print each line inconfig? Thank you :).new codeto the post that if I just print the$line, I do see eachvar` printed. However when I re-direct it to the script I do not see them. Are they avaliable to the script to use? Thank you :).