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
output console problem arghya_owen Shell Programming and Scripting 1 06-17-2008 07:11 AM
Output Problem Eric_Bakken UNIX for Dummies Questions & Answers 3 12-09-2005 03:16 PM
problem with who -u output V.V.KUMAR UNIX for Advanced & Expert Users 0 04-20-2005 11:31 PM
Problem With Who-u Command Output V.V.KUMAR UNIX for Advanced & Expert Users 2 04-12-2005 12:37 AM
somewhat unusual top output problem ohhmyhead UNIX for Dummies Questions & Answers 4 07-17-2004 11:44 PM

 
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 Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-27-2008
snake450 snake450 is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 5
Problem in output

When i use the following command to get only the ip address from a file then i get a whole sentence and not only the ip address which i want.

here is the script i am using:

grep '^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$'

for example if this the file content:

Many blogs provide commentary or news on a particular subject; others function as more personal . A typical blog combines text, images, and links to other blogs, and other media related to its topic. The ability for readers to leave comments in an interactive format with ip address 129.23.45.78

then the output looks like this :

leave comments in an interactive format with ip address 129.23.45.78

but the desired output should be like this:

129.23.45.78

what should i do to fix the problem?
 

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 04:05 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