LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   123 file input is not taking for i in $(cat ./123) (http://www.linuxquestions.org/questions/programming-9/123-file-input-is-not-taking-for-i-in-%24-cat-123-a-465738/)

procfs 07-19-2006 10:14 PM

123 file input is not taking for i in $(cat ./123)
 
Hi

What I want to do is to get the output in to "i" row at a time

the command before executing should looks like smbldap-groupadd.pl -a "ama ana"

What is that I am doing wrong

The syntax that I am giving is at the prompt

root@local# for i in $(cat ./123)
>do
>smbldap-groupadd.pl -a $i
>done

and the 123 content is just two rows

ama ana
as ad


Regards
Asanka

spooon 07-19-2006 10:33 PM

Code:

while read i
do
  smbldap-groupadd.pl -a "$i"
done < 123


procfs 07-20-2006 03:57 AM

Hi snoop

your script works but when I try to look at ldap database he says he faild to read entry cn=ama ana,ou=Groups,dc=iil,dc=informaitcs,dc=lk

But if you do the smbldap-groupadd.pl -a "alon aaa" it workes form the command prompt

procfs 07-20-2006 04:10 AM

Ha Spooon it works it was my mistake I dont understand the syntax is it possible for you to tell me what is going on done < 123

Thanks regards

Asanka


All times are GMT -5. The time now is 07:52 AM.