This is my script
[root@localhost scripts]# cat nested.sh #!/bin/ksh echo Enter the level of nesting read lev echo Enter the directory \( Enter the Absolute Path\) read path echo Enter the directory name read $dirname cd $path for((i=1;i<=$lev;i++)); do mkdir '$dirname$i' cd '$dirname$i' done echo $dirname$i
Assume that towards the end the value of $dirname is "fold" and value of $i is "5".
I was expecting the last statement
echo $dirname$i to print fold5
but instead it only prints 5.
Can someone please explain how to print "fold5" ?
Also can someone please explain why it only printed 5 for me ?