$
on the iterator name in for loops.for $var in *
do
echo "$var"
done
for var in *
do
echo "$var"
done
The variable is named var
, and can be expanded to its
value with $var
.
The for
loop expects the variable's name, not its value
(and the name can not be specified indirectly).
None.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.