|
|
#1 |
|
unix: odd behavior w/ 'find' command
the other day i tried running a certain construct of the find command, via command line, but it didn't work:
Code:
% find . -type f -exec grep foo {}\; -print
i was able to find a workaround (for those interested): Code:
% find . -type f -print | xargs grep foo any unix heads know what's up w/ the first find? has 'find' changed since i was doing all my unix coding? i'm running 10.2.2, if that matters.
__________________
Oct 2011: check out my band's first album @ boxsetauthentic.com |
|
|
|
0
|
|
|
#2 |
|
May I ask what the purpose of the command is? Maybe you don't need the -print option if you use other grep switches, e.g.,
% find . -type f -exec grep -l foo {} \; |
|
|
|
0
|
|
|
#3 | |
|
Quote:
does this work on your machine? oh -- the purpose is to search a subdir for files containing the string "foo". well, okay, i was searching for "smtp." but you get the idea.
__________________
Oct 2011: check out my band's first album @ boxsetauthentic.com |
||
|
|
0
|
|
|
#4 |
|
Yes, the find command that I suggested works for me - to display the names of files in the current directory or any subdirectory, recursively, that contains the string "foo". The -l switch of the grep command means "display filename instead of displaying the matching line".
Please note that a space before the \; is required, as in the example I gave. |
|
|
|
0
|
|
|
#5 | |
|
Quote:
that's it. thank you. gee, i actually knew unix once upon a time...
__________________
Oct 2011: check out my band's first album @ boxsetauthentic.com |
||
|
|
0
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Disappearing Folders, Files & Other Odd Behavior | nygladiator2008 | Mac OS X | 2 | Aug 5, 2008 04:00 AM |
| 3G sync question - odd behavior | jsgreen | iPhone Tips, Help and Troubleshooting | 0 | Jul 28, 2008 01:17 PM |
| Odd behavior, blue hue over the screen when switching users? | BiikeMike | MacBook Pro | 5 | Mar 25, 2008 05:11 PM |
| OSX Tiger odd behavior after crash | TheBrazilianGuy | Mac OS X | 2 | Mar 3, 2008 01:26 PM |
| cingular razr odd behavior w/ headset | Sean7512 | Community Discussion | 0 | Jul 31, 2006 10:14 PM |
All times are GMT -5. The time now is 07:13 AM.




I support the
Linear Mode

