Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Analysis | 8 comments | Create New Account
Click here to return to the 'Analysis' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Analysis
Authored by: signals on Dec 18, '02 03:46:38PM

> sed 's/.[^.]*$//
> change the output somehow (I'm not sed fluent at all)

The pattern s/{regex}/{string}/ is a search and replace function.

The regex is ".[^.]*$" which matches the part of the line from the last "." to the end of the line (see the manpage for ed(1) for help with regular expressions)

The string to replace it with is nothing ("//").

So this will take everything from the last period on the line to the end of the line and remove it (replaces it with nothing).

This drops the port numbers from the end of the ip numbers netstat returns.

-Signals



[ Reply to This | # ]