Brian Button - One Agile Coder

Blogging on all things .Net, C#, and Agile

My Links

Blog Stats

News

Archives

Post Categories

Agile Solutions Group

Blogs I read

Enterprise Library V1 Team

find -name foo.\* | xargs grep "find_me"

[Update from Brad Wilson and Scott Dukes]

I've been wanting a powershell script to replace my favorite unix command for ages, and I took a stab at it today. This got me very close to what I wanted yesterday, which was just the names of files where the matches occurred.

get-childitem -include foo.* -recurse | where-object { get-content $_ | select-string find_me }

Scott Dukes pointed out that select-string would take the FileInfo object that was passed to it and search through the contents for the string file_me, and this would give me the exact same kind of output my unix command used to. Thanks, Scott! This command was exactly what I needed.

Brad went way past this and showed some very interesting other changes to the script to do some cool things.

Thanks again to both of them for correcting this PowerShell newbie. I've been a long-time Unix scripting weenie, with bash code flowing out my fingertips at will (in XEmacs of course :)), but I think PowerShell just blows that away.

-- bab

posted on Thursday, March 22, 2007 4:50 PM

Feedback

# Brian's Find Dilemma 3/22/2007 4:36 PM Brad Wilson - The .NET Guy

# Interesting Finds: August 1, 2007 8/1/2007 7:23 AM Jason Haley

# re: find -name foo.\* | xargs grep "find_me" 3/31/2008 8:14 PM crystal

That's a great help. Nice post

# re: find -name foo.\* | xargs grep "find_me" 5/28/2008 1:53 AM Ben

Overall Petit Roid 3 is a hilarious hentai manga that has so many merits, which separate it from the average hentai manga; such as its length and the fact that it follows one story throughout. It manages to contain plenty of fetishes (loli, bukkake, S&M, etc.) to satisfy any guy who reads this and what’s more amazing
http://triometr.info/index.php?sm=6
http://forter.info/index.php?sm=8
http://forter.info/index.php?sm=9
http://kriomotors.info/index.php?sm=4
is how it can give you boner and make you laugh at the same time. But nonetheless it still is a hentai manga and there’s only so much that it can accomplish, still it is definitely one any perv should check out.

# hola 5/30/2008 9:29 AM hoteles baratos

That was intresting post

Title  
Name  
Url
Spam Protection:
Enter the code you see:
If you can't read it, click your refresh button to get a new image.
Comments