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 |
i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..
write a shell script to check whether all the directories in the path exist has read and write permission
Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.
What is the syntax of while loop in shell scripting?
How to rename all the files in a folder having specific extension? Example: I have some files with extension (.txt) in a folder name 'Test'. I have to rename all the .txt files in a test and its subdirectories to .my extension.
When you login to a c shell, which script would be run first?
What lives in a shell?
Why are shell scripts used?
What are script files?
What is a shell made of?
What does egrep mean?
What are the 3 standard streams in linux?