Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
Linux in General => Linux Development & Programming => Topic started by: purusrhce on October 01, 2006, 04:32:34 AM
-
hi all,
i am having an issue while creating user account. i wrote a script for creating a user account in the name of 132001 to 132050.
when i run the script i am getting an error message showing invalid user account.But if i run the script to create a name (ex) ram, tony ..... i can create an user account. i am using redhat linux 9.
can anyone pls tell me how to solve this problem.
Thanks in Advance,
Purushothaman.
-
Ok
Just , send or Paste your scripting code here....,otherwise its difficult that where u r getting error...
Gaurav
-
Ok
Just , send or Paste your scripting code here....,otherwise its difficult that where u r getting error...
Gaurav
hi gaurav,
Here the script
for I in $ (seq 113001 113050)
do
useradd $I
echo password | passwd --stdin $I
chage -d 0 $I
when i run this script i am getting invalid user name,but if i am doing like this i can create
for I in $@
do
useradd $I
echo password | passwd --stdin $I
chage -d 0 $I
if i run this script (i.e) bash users ram tony ........... i can create user accounts
I want to create a user account in numbers i.e 113001, 113002 ...........
I am waiting for your Reply.
Thanks in Advance,
Purushothaman.
-
Why not u try to debug the script using -x option while running ur shell script?
i.e.:
root@localhost# bash -x /path/to/your-script
i assume ur using bash shell scripting. If it's not sorry, u can ignore what i shared with you here.
-
Do one thing enclose your numbers i.e 113001 with single quotes, so that it behaves like chracter string .........
I haven't tried this as I dont have the Linux/Solaris PC having root privalages, but just give a try
-
Do one thing enclose your numbers i.e 113001 with single quotes, so that it behaves like chracter string .........
I haven't tried this as I dont have the Linux/Solaris PC having root privalages, but just give a try
what this all scripting about i wanna learn and join
-
We were talking about shell scripting , search google to know more.
Thanks
Gaurav