HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL
SHELL SCRIPT?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Why do we use shell scripting?
is there any command to find user password?
What are the various stages of a linux process it passes through?
What are the advantages of shell scripting?
What is the use of "$?" Sign in shell script?
Which scripting language is best for automation?
how to delete all the files with extension .dat rom a directory tree from root to third level in a single unix command?
Explain about echo command?
When we login into our account which files are executed?
What is the difference between a variable and value?
What is the syntax of while loop in shell scripting?
What is Linux language details