BASH: Substituting a variable inside a variable during echo -
i explained question in comments:
var= ins="installing $var" echo $ins . # in each echo command want dynamically substitute . # $var variable in $ins variable. want echo $ins # substitution of variable on echo command.
is possible?
you need function job gracefully.
say() { echo "installing $ins" } ins=hello ins=world
or this:
say() { echo "installing $@" } hello world
Comments
Post a Comment