I have a very simple code as below.
myVal=""
for ((i=1 ;i<=5 ;i++))
do
myVal+=" * "
echo $myVal
done
Issue is:
- I am not able to use
+=
in this shell script code. - When I am assing a
*
in varibale, it prints all files which are in my working directory.
Output:
*
* *
* * *
* * * *
* * * * *