Computing.Net > Forums > Unix > shell awk

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

shell awk

Reply to Message Icon

Name: mehul
Date: May 21, 2003 at 13:07:43 Pacific
OS: sun
CPU/Ram: sun
Comment:

Hi
I need some help.....

i have a test file
each line have some information
i want to search for a particular word (basically a file name of same extension eg filename.log)
if i find this extension ".log" in any lines in a file i need that whole line to be stored in different file

i need to know i can grep for that extension but how do i copy that particular line on which i found that extension in another file

any ideas...your help will be appreciated

Thx
Mehul




Sponsored Link
Ads by Google

Response Number 1
Name: LANkrypt0
Date: May 21, 2003 at 13:56:41 Pacific
Reply:

This is an easy one.
If you want the output to go to different files

grep word filename.log > outputfile

if you will put the output in the same file:
grep word filename.log >> outputfile

Thats about it.

To have grep not care about case use:
grep -i


0

Response Number 2
Name: mehul
Date: May 21, 2003 at 14:53:15 Pacific
Reply:

Hi LANkrypt0

Thx a lot it worked....


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


K-shell script argument two simple questions



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: shell awk

How to call other shell/awk script www.computing.net/answers/unix/how-to-call-other-shellawk-script-/5571.html

Scrips www.computing.net/answers/unix/scrips/4114.html

shell/awk www.computing.net/answers/unix/shellawk/3860.html