I'm quite confused When I try to ouput some patterns with * in shell.The code is:
#!/bin/bash
for i in {1..10}
do
tmpstr=""
for ((c=1;c<=i;c++))
do
tmpstr=$tmpstr'*'
done
echo $tmpstr #add some string after tmpstr will work
done
The output shows me the result of ls command in each line which is unexpected. And the code will works fine if I add any string after echo $tmpstr.For example,echo $tmpstr" " .So how to understand this?