I have an environment variable called $TEST which refers to a directory in my bash script I have a variable called $VARTEST which is $TEST/dir/file
now I want to grep the file specified by $VARTEST so I try to do:
grep somestring $VARTEST but it doesn’t translate $TEST into it’s directory
I’ve tried different combinations of {}, '' and '' but without success
I think you want
or even
but remember (as others already said): If possible use
instead of
use the second one only if you really need kind of ‘lazy evaluation’…
Warning, this could be dangerous if
$VARTESTcontains malicous code.