Posts tagged as:

loop command

If you would like to copy a set of files for all existing users, use the following scripting trick. It will save lots of manual work.
First you need to grab all user names from /etc/passwd file using cut comand:
cut -d: -f1 /etc/passwd
Next use shell for loop command to apply copy and set the correct permissions [...]

{ 8 comments }

One our reader asks:

How do I generate a range of numbers under BASH for loop command? For example, I need to run particular command inside loop 100 or 500 times. Basically I want function that counts FROM and TO a range of numbers like 50-10.

{ 8 comments }