Iterate a Text File in Bash
This is how you iterate thru a text file outputting a line at a time in Bash shell scripting.
IFS='\n'; for i in(cat FILE.TXT); do echo "$i"; done
This is how you iterate thru a text file outputting a line at a time in Bash shell scripting.
IFS='\n'; for i in(cat FILE.TXT); do echo "$i"; done
This command will import all the MySQL sql dumps in the current folder. You can use this to restore your backuped databases.
for i in *; do mysql -uroot `basename $i .sql` < $i; done
Use this command to download numbered content…
for ((i=1; i<9; i++)) ; do wget "http://www.example.com/$i.txt" ; done
This is how you zero pad a numerical variable in bash.
for ((x=1;x<=31;x+=1)); do echo `printf "%02d" $x`; done