I set a variable
TEMPP='-I ../dir1 -I ../dir2'
then I run
gcc -M $TEMPP somefile.c
It seems not to include
../dir2 in the search list of the include file, and if there is a space at the beginning of the variable, like
TEMPP=' -I ../dir1 -I ../dir2'
it reports an error:
gcc: -I ../common1 -I ../encrypt: No such file or directory
so it seems the variable was treated as a file.
Maybe it will let me separate the directory to avoid this promblem, but those included
dirs are generated by another command, and the amount is not constant.
So how can I let a variable in a command be treated as literal seem like a manual input in command line, not an integral string or a file name?
OK...I find this situation only happened in the
zsh, but in bash it works well...
may be in
zsh the expansion of variable is special.
So if anyone can tell me how can this work well in zsh I will appreciate, or I can only do this in bash.