The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search for a word on9west Shell Programming and Scripting 2 04-23-2008 04:15 AM
Word search in awk videsh77 Shell Programming and Scripting 8 03-08-2007 11:40 PM
Search about word abu_hassan SUN Solaris 3 02-19-2007 01:17 PM
search for certain word in a files from directory legato UNIX for Dummies Questions & Answers 1 10-31-2006 06:35 AM
Is there any way to open vi on line or word ? umen UNIX for Dummies Questions & Answers 1 04-26-2006 11:25 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 2.00 average. Display Modes
  #1 (permalink)  
Old 06-02-2008
stalin2020 stalin2020 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 5
Thumbs up How can i open a directory and search a word using awk....

Hi guys,I m new one in awk scripting....i want to search a word with in a directory...in that directory haviing many files...if i give a work ,it should open the directory and open each file for to search that particular word....is it possible in awk...tell me guys its really urgent....
  #2 (permalink)  
Old 06-02-2008
rajendra44 rajendra44 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 10
Thumbs up

Hi ,

Doubt on u r Q ..?

1.U want the only list of the files which are WORD contains ..??
or
2.U want search the WORD and process using the awk ..??

For 1st :Try this
grep -l <word> <Dir_Path>/*.*

for 2nd :Try this => will print the line
awk '{ if ( $0 ~/<word>/ ) {print $0} }' <Dir_Path>/*.*


Try this let me know its working for u or not
happy learning .
thanks
Raj
  #3 (permalink)  
Old 06-02-2008
stalin2020 stalin2020 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 5
Thank raj....
can we give the directory path inside the program...not in comman line....i m writing a program in a file...then i m executing that file...so can u tell me that how can we give the directory path inside the program...i tried a lot....
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0