November 22, 2024, 05:00:25 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: user administration(2)  (Read 9632 times)

Offline purusrhce

  • Linux Noob !
  • *
  • Posts: 11
user administration(2)
« 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.

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
user administration(2)
« Reply #1 on: October 04, 2006, 04:51:26 AM »
Ok

Just , send or Paste your scripting code here....,otherwise its difficult that where u r getting error...

Gaurav

Offline purusrhce

  • Linux Noob !
  • *
  • Posts: 11
user administration(2)
« Reply #2 on: October 04, 2006, 06:06:11 AM »
Quote from: "gauravbajaj"
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.

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
user administration(2)
« Reply #3 on: November 12, 2006, 03:43:09 AM »
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.

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: user administration(2)
« Reply #4 on: June 14, 2007, 03:52:39 AM »
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

Offline Ujjwol

  • Linux Learner
  • ***
  • Posts: 54
Re: user administration(2)
« Reply #5 on: August 11, 2007, 07:58:47 AM »
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

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: user administration(2)
« Reply #6 on: September 18, 2007, 10:27:34 AM »
We were talking about shell scripting , search google to know more.

Thanks
Gaurav