![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| grep string and output filename | happyv | Shell Programming and Scripting | 3 | 11-20-2007 12:16 AM |
| Get Filename and Line Number using grep | ceemh3 | UNIX for Dummies Questions & Answers | 4 | 09-17-2007 10:35 AM |
| Print filename and resolution in wrkng dir | rocinante | Shell Programming and Scripting | 6 | 06-11-2007 02:52 AM |
| grep and awk showing filename in loop | sjohns6 | Shell Programming and Scripting | 5 | 05-24-2007 08:59 AM |
| Losing filename in grep output | netguy | Shell Programming and Scripting | 6 | 04-27-2004 11:39 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
using grep and print filename
Hi,
I have a question on bash. Basically I would like to print a file name using bash. I am actually trying to grep a particular character in sequential files. I have alot files such that a.txt, b.txt,c.txt...etc. If I found a certain character, I would print that particular filename. I used something like Code:
cat *.txt|grep -w 56|awk '{
if($1 -eq "bla1")
then
print the filename (e.g a.txt)
Please help!.Thanks. -Jason |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|