HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL
SHELL SCRIPT?

Answers were Sorted based on User's Feedback



HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?..

Answer / nimal

#!/bin/sh
for i in {1..10)
do
echo "creating user"$i;
useradd user$i;
done

to list the created users.

cat /etc/passwd

Is This Answer Correct ?    9 Yes 2 No

HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?..

Answer / pitambar mishra

My dear friends,
you have used 'useradd' command in the script through which we can only add the user name. But for adding password you should use 'passwd' command because password is also mandatory.

Is This Answer Correct ?    0 Yes 0 No

HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?..

Answer / dibala

#!/bin/ksh
set -x #on
#variable
i=1
while [ i let 10 ]
do
/usr/sbin/useradd user$i -d /home/user$i -s /bin/ksh -m
user$i
i=$(expr $i + 1)
done

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Shell Script Interview Questions

What is a shell made of?

0 Answers  


How would you print just the 25th line in a file using smallest shell script?

4 Answers  


What is Linux language details

0 Answers   Quick Heal,


how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

0 Answers  


How do I stop script errors?

0 Answers  






What are the different types of commonly used shells on a typical linux system?

0 Answers  


What is shell application?

0 Answers  


What is a program shell?

0 Answers  


Please give me example of " at command , contrab command " how to use

0 Answers  


How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output of ls -l command.

6 Answers   TCS,


Hi, i want to zip the files that generates automatically every few minutes (files generated are in .arc extension)....any body write a script for this... thanks in advance

5 Answers   HP,


I want to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?

1 Answers  


Categories