For loops Scripts for File System - 1 ========================================== 1 - Simple counting: #!/bin/bash for i in {1..25} do sleep 1 echo $i done -------------------------------------------------- 2 - Create multiple files with different names #!/bin/bash for i in {1..10} do touch imran.$i done -------------------------------------------------- 3 - Create multiple files upon input #!/bin/bash echo How many files do you want? read t echo echo Files names should start with? read n for i in $(seq 1 $t) do touch $n.$i done -------------------------------------------------- 4 - Assign write permissions to files #!/bin/bash for i in imran* do echo Assigning write permissions to $i chmod a+w $i sleep 1 done -------------------------------------------------- 5 - Assign write permissions to files with total time it will take #!/bin/bash total=`ls -l imran* | wc -l` echo It will take $total seconds to assign permissions... echo for i in imran* do echo Assigning write permissions to $i chmod a+w $i sleep 1 done