LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-11-2012, 11:20 AM   #1
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 147

Rep: Reputation: 2
About grep - why doesn't function like it should


Hello,

I was trying to do some search through my files with grep, and in some cases, the program doesn't seem to function, also it appears like it does. For example, if i try:

grep -R hello .

where, . is ~, initially it processes the files, but at some point it stops, like it goes to sleep. The same with

grep -R mmap Documentatie/USO

but this time it does nothing, also it appears like it works.

Strange is that when i try, for example

grep -R hello /usr

it works, without stopping. Or when grepping the /.

The answer is why is that? What is the problem? Thanks in advance.
 
Old 06-11-2012, 11:25 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you can use strace <command> to check what your command tries to do. Hopefully you will find grep works without problems just no new file found.






__________________________________
Happy with solution ... mark as SOLVED
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
 
1 members found this post helpful.
Old 06-11-2012, 11:44 AM   #3
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 147

Original Poster
Rep: Reputation: 2
Ok, i might have found the problem, it is a named pipe/fifo that it stops when it reaches to it, or when it opens it.
 
Old 06-11-2012, 11:48 AM   #4
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 147

Original Poster
Rep: Reputation: 2
Yes, that's it. Thanks for the clue.
 
Old 06-12-2012, 10:02 AM   #5
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
I generally use this command for recursive search / grep:

find . -exec grep -Hni <whatever> {} \;

but that's just me.
 
1 members found this post helpful.
Old 06-12-2012, 01:22 PM   #6
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 147

Original Poster
Rep: Reputation: 2
Thanks, i was trying to do it like this some time ago, but for some reason it didn't worked, so i discovered the other method finally. Thanks for enlightening my spirit.
 
  


Reply



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
webgl doesn't function in FF 5.0 entz Linux - Software 15 07-09-2011 08:19 PM
perl grep function casperdaghost Linux - Newbie 7 06-04-2011 08:46 PM
grep/egrep logical AND function? boozer_2 Linux - Newbie 11 04-10-2010 01:19 AM
Using 'grep' to retrieve a function definition vdeych Programming 2 09-24-2008 04:28 AM
X server doesn't function raport Red Hat 2 08-02-2006 10:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:47 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
Open Source Consulting | Domain Registration