|
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?
|