Tuesday, June 18, 2013

UNIX/Linux Shell script to create multiple users

Example 1:








NOTE: {1..5} syntax will not work in certain shell. But it will work definitely in bash.

Example 2:

cat > user.list
vijay
sanjay
ajay
sujay

for user in `cat user.list`;do useradd $user;done

grep -i jay /etc/passwd | cut -d: -f1
vijay
sanjay
ajay
sujay

2 comments:

BharathKumarRaju Dasararaju said...

sooper VJ

ERP said...

Hi,

your article so informative and i have cleared all of my doubts.
your way of explanation is awesome thank you for sharing useful information.

regards,
Oracle Fusion HCM Training