Shell Script Examples
Linux Users:- abc, xyz, sankar, sai
Script:-
root@sankar:~# for i in abc xyz sankar sai; do echo "Locking user $i" && passwd -l "$i" ; done
Locking user abc
Locking password for user abc.
passwd: Success
Locking user xyz
Locking password for user xyz.
passwd: Success
Locking user sankar
Locking password for user sankar.
passwd: Success
Locking user sai
Locking password for user sai.
passwd: Success
Linux Users:- abc, xyz, sankar, sai
Script:-
root@sankar:~# for i in abc xyz sankar sai; do echo "Locking user $i" && passwd -l "$i" ; done
Locking user abc
Locking password for user abc.
passwd: Success
Locking user xyz
Locking password for user xyz.
passwd: Success
Locking user sankar
Locking password for user sankar.
passwd: Success
Locking user sai
Locking password for user sai.
passwd: Success