Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

How to know that your remote server is ruing smoothly or not in unix?

1 Answers  


Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.

0 Answers  


what is info area how many types?

0 Answers  


Write a shell script to get current date, time, user name and current working directory.

0 Answers  


Which is best institute for testing tool?

0 Answers  


What is bourne shell scripting?

0 Answers  


How to take input values from the user?

4 Answers  


How do you debug a script?

0 Answers  


Given a file find the count of lines containing the word "abc".

0 Answers  


What language is bash written in?

0 Answers  


Why is the use of shell script?

0 Answers  


How many prompts are available in a UNIX system?

1 Answers  


Categories