Quote:
Originally Posted by sysgate
cat /etc/passwd | head -100 | tail -1 && passwd <the-result>
I think this can be done with sed also.
From what I understand he doesn't want to change the password for the user who is on line 99 in the password file, but for all users in the password file he wants to set the password equal to the username added with +99.
If this is the case you have to be very carefull about it.
Do NOT change the password for system related accounts, some of them are
locked for a good reason.
Furthermore, it is not wise to set passwords to such a simple pattern, especially when your system can be reached from the outside world. Because your system will be hacked in no time.
Please clarify first if you actually want to set the password for each user to "<username>+99".
If this is the case, and it is really what you want, we can take it further from there.