The syntax is as follows to run for loop from the command prompt.
Run Command 5 Times
OR
for i in {1..5}; do COMMAND-HERE; done
for((i=1;i<=10;i+=2)); do echo "Welcome $i times"; done
Work On Files
OR
for i in *; do echo $i; done
for i in /etc/*.conf; do cp $i /backup; done
No comments:
Post a Comment