Say I have a function
print_args () {
for i in $@; do
echo "$i"
done
}
When I do
foo='\*'
print_args $foo
I get
\*
(with the backslash) as output.
If I change the definition of foo
to foo='*'
instead, I get all the files in the current directory when running print_args $foo
.
So I either get the backslash included, or the *
interpreted, but I don't see how to get the *
literally.
The output is the same whether I include double quotes around $foo
or not.