LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2005, 04:00 PM   #1
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Rep: Reputation: 30
grep problem


from what i read from grep --help
and more --help
i understand that this command
more addrbook-* | grep -H panarama

should give me the name of all the files starting with
"addrbook-" that have
string "panarama" included(this works)
and because of parametere -H also the name of the
file in wich this string was found

Instead of what i want i get this:

(standard input): <person uid="136621772" first-name="gagici" last-name="gagici" nick-name="gagici" cn="panarama" >

What has caused that (standard input) still haunts me
please help

why is the name of the file in wich string occurence is
not displayed ?
 
Old 12-14-2005, 04:10 PM   #2
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Easier to grep directly without paging: grep -H panarama addrbook-*
If you want paging, add it to the end: grep -H panarama addrbook-* | less

Last edited by makuyl; 12-14-2005 at 04:12 PM.
 
Old 12-14-2005, 04:17 PM   #3
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Original Poster
Rep: Reputation: 30
sorry doesnt work
 
Old 12-14-2005, 04:29 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,728

Rep: Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123
Quote:
Originally Posted by spx2
What has caused that (standard input) still haunts me please help

why is the name of the file in wich string occurence is not displayed ?
Standard input is the filename. After more has finished it's job, the output is piped (as STDIN) to your grep command.
The (original) filename is no longer available - or relevant given that you used more.

This is a pretty poor way of achieving your end result I suspect.
 
Old 12-14-2005, 04:42 PM   #5
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Original Poster
Rep: Reputation: 30
starting to hate bash,part I

more `find` supposed to list me contents
of all files in current path ?
why is all failing me ?
i dont understand bash please help
 
Old 12-14-2005, 04:45 PM   #6
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Original Poster
Rep: Reputation: 30
ill close linux for today
its enough
my brains are really hurting
and im in real pain
no food for about 8 hours
allot of walking in bucharest
thinking in the subway about how to get
those bitc*** of programs and scripts
working
read some papers but not enough i suppose
i wont be using linux for a while until i
calm down.
ill be seeing you people then.
for now im a little angry
but thanks allot for the help
(not in all cases but most)
 
Old 12-14-2005, 04:51 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,728

Rep: Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123Reputation: 2123
I think you might find A_Couple_Quick_find_Tips useful.
 
Old 12-14-2005, 05:00 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by spx2
more `find` supposed to list me contents
of all files in current path ?
why is all failing me ?
i dont understand bash please help
One step at a time...........

Did we answer the grep question?

find---did you read the man page? (type "man find")
You have to tell it the file you are looking for.

All is not failing you---you will be rewarded for patience
 
Old 12-14-2005, 05:55 PM   #9
liamoboyle
Member
 
Registered: Mar 2004
Location: Wellington, New Zealand
Distribution: Debian
Posts: 127

Rep: Reputation: 15
Hmmm. makuyl's suggestion should work. What happens when you try it? Looks like the most simple solution to me.
 
Old 12-15-2005, 01:22 AM   #10
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Well, the commands I posted work for me. Perhaps you use a different shell, "echo $SHELL" will tell, I use /bin/sh.
Also type "less" to see if it's installed, "q" quits. Some more reading: http://www.faqs.org/docs/linux_intro/index.html , try chapters 3.3 and 5.1
 
  


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
grep problem michaelsanford Linux - Software 2 05-20-2005 07:23 PM
Grep problem chup Linux - General 7 04-17-2004 12:08 AM
Filtering Problem (using grep) gauge73 Linux - Newbie 4 12-16-2003 10:35 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM
PERL: problem with grep ocularbob Programming 9 05-01-2003 05:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration