LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-19-2006, 10:14 PM   #1
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 484

Rep: Reputation: 34
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
 
Old 07-19-2006, 10:33 PM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
Code:
while read i
do
  smbldap-groupadd.pl -a "$i"
done < 123
 
Old 07-20-2006, 03:57 AM   #3
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 484

Original Poster
Rep: Reputation: 34
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
 
Old 07-20-2006, 04:10 AM   #4
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 484

Original Poster
Rep: Reputation: 34
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

Last edited by procfs; 07-20-2006 at 04:32 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script help, remove periods from 123.456.789 GUIPenguin Linux - General 2 04-15-2006 09:42 PM
Ubuntu Easy as 123 !!! gonzojd7 LinuxQuestions.org Member Success Stories 6 11-04-2005 04:49 PM
I only need the disc 123 not all 15 right? coolbreeze7000 Debian 5 01-23-2005 08:50 PM
NTP listening on UDP+TCP(!)/123 hugohindemith Linux - Networking 4 12-15-2003 10:11 AM
mpeg 123 installed mp3's not working CrushGruve Linux - Software 1 01-08-2003 05:38 PM


All times are GMT -5. The time now is 08:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration