News, reviews, tips and tutorials for professional system administrators. Jan 06, 2009 - 07:52 AM
Homepage :: Downloads :: WebLinks :: FAQ 
Search   

Login




 


 Log in Problems?
 New User? Sign Up!

Main Menu


Subscribe to our feed

Distractions

New Links!

Other Good Books

Online
There are 1 unlogged user and 0 registered users online.

You can log-in or register for a user account here.

Topic: Scripts You Shouldn't Be Without

The new items published under this topic are as follows.
Findstr - A simple shell script to find files that contain a string.
Posted by: jaye on Saturday, September 03, 2005 - 08:40 AM
Scripts You Shouldn't Be Without findstr

This is one of my favorite scripts, both for its simplicity and its usefulness. In a nutshell, it just uses find and grep to search for a string. It uses the "-i" flag for grep to do a case insensitive search. The script is simplified by not accepting a path as input. It simply starts its search from the current working directory. The example, below, searches for "any key" starting in the current directory.

jaye@tara: ~/bin> findstr any key
./tests/testkey
jaye@tara: ~/bin>

In this case, it found the line echo "HIT ANY KEY TO CONTINUE: \c"  in the file testkey.

(1001 Reads) Read full article: 'Findstr - A simple shell script to find files that contain a string.' (1163 bytes more) Send this story to someone Printer-friendly page

PostNuke :: PostNuke Support :: Developers 
Copyright (c) 2001-2005, Outstanding Imagery - All Rights Reserved