Thanks This program will extract names from an input and put them into another command.
userfile=$1 s=0 for i in 'cat $userfile ';do # s=$s+1 NAME='cut -d : -f1' echo $NAME # echo $s done The output is as below instead of a list of names as I would like [root@Lizzi root]# ./addscusers scusers cut -d : -f1 [root@Lizzi root]# Many thanks Mike -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Adam H. Pendleton Sent: Monday, 2 December 2002 07:56 To: [EMAIL PROTECTED] Subject: RE: Shell scripting help *This message was transferred with a trial version of CommuniGate(tm) Pro* Change the line: $NAME='cut -d : -f1' to be: NAME='cut -d : -f1' $NAME as a left-hand operator causes expansion, which in this case probably expands to "", leaving you with: ='cut -d : -f1' which is the text of your error message. ahp > -----Original Message----- > From: Mikevl [mailto:[EMAIL PROTECTED]] > Sent: Sunday, December 01, 2002 13:52 > To: Redhat-List (E-mail) > Subject: Shell scripting help > > *This message was transferred with a trial version of CommuniGate(tm) Pro* > *This message was transferred with a trial version of CommuniGate(tm) Pro* > Thanks Robert > > No I didn't name the file useradd it has quite a different name > The cut command works from the command line but from the script I get > > [root@Lizzi root]# ./addscusers scusers > ./addscusers: =/bin/cut -d : -f1: No such file or directory > > Many thanks > > Mike > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Robert P. J. Day > Sent: Monday, 2 December 2002 07:08 > To: [EMAIL PROTECTED] > Subject: Re: Shell scripting help > > > On Sun, 1 Dec 2002, Bill Horne wrote: > > > ----- Original Message ----- > > From: "Mikevl" <[EMAIL PROTECTED]> > > > > > > > Hi > > > > > > Can anybody help with this simple script > > > > > > Command is useradd userfile > > > > > > > > > useradd > > > userfile=$1 > > > s=0 > > > for i in 'cat $userfile ';do > > > $NAME='cut -d : -f1' > > > echo $NAME > > > done > > > > info cut. > > *please* tell me you didn't actually name the executable > script file "useradd". > > rday > > > > -- > redhat-list mailing list > unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe > https://listman.redhat.com/mailman/listinfo/redhat-list > > > > -- > redhat-list mailing list > unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe > https://listman.redhat.com/mailman/listinfo/redhat-list -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list