How to defer the name variable in our Bash script so that it expands correctly within quotes in the loop, in such e.g:
name='*'
curate() {
local e=
for e in $(export HOME='/home/me'; echo /home/me/Downloads/\${name}.$1)
do
[ -e "$e" ] && echo "$e"
done
}
curate() c
name=foo
curate() c
as it didn't work.
Please help in clear way
curate() c- Sidenote, functions are called simply by invoking their names, i.e. without().HOMEin your command substitution to accomplsh for you?echocommand in that same process substitution to accomplish for you, especially given that you are escaping the first$?