- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Scripting question for you geniuses.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 03:03 AM
тАО04-27-2005 03:03 AM
Search standard out from a command and only display lines after a certain point.
EX:
netstat -a command
Look for "Active UNIX domain sockets"
and only display the lines of output that come after that appears.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 03:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 03:09 AM
тАО04-27-2005 03:09 AM
Re: Scripting question for you geniuses.
awk '
/string/ {flag = 1;}
{if ( flag == 1 ) print $0;}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 03:10 AM
тАО04-27-2005 03:10 AM
Re: Scripting question for you geniuses.
# netstat -a command | perl -ne'/Active UNIX domain sockets/..undef and print'
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 03:42 AM
тАО04-27-2005 03:42 AM
Re: Scripting question for you geniuses.
Not at a machine right now, but doesn't 'netstat -af unix' pretty much give you the same thing?
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 03:52 AM
тАО04-27-2005 03:52 AM
Re: Scripting question for you geniuses.
It may, that wasn't really the command I wanted to do this on, but it was an easy command to show what I meant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 04:22 AM
тАО04-27-2005 04:22 AM
Re: Scripting question for you geniuses.
You don't like perl?
Just curious.
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 04:52 AM
тАО04-27-2005 04:52 AM
Re: Scripting question for you geniuses.
Yours didn't work for me, although I'm sure it works.
Got this error: "Reading from a core file is no longer supported."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 05:01 AM
тАО04-27-2005 05:01 AM
Re: Scripting question for you geniuses.
Better luck next time.
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 05:04 AM
тАО04-27-2005 05:04 AM
Re: Scripting question for you geniuses.
/usr/bin/perl
root@datapro:/root-> perl -v
This is perl, v5.8.3 built for PA-RISC2.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 05:33 AM
тАО04-27-2005 05:33 AM
Re: Scripting question for you geniuses.
unnecessarily complicated than it should be, then
use:
# netstat -a | tail -n$(echo $(netstat -a | wc -l) - \
$(netstat -a | grep -n "YOUR_SEARCH_STRING" \
| head -n 1 | awk -F: '{print $1}') | bc)
No points for bad programming, please :-)
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2005 06:19 AM
тАО04-27-2005 06:19 AM
Re: Scripting question for you geniuses.
4232ec00 dgram 0 0 425b7000 0 0 0 /dev/log.un
4297f200 dgram 0 0 4297a000 428fe180 0 0 /opt/dcelocal/var/rpc/local/01158/c-3/7000
42dcfc00 stream 0 0 0 67e2da00 0 0 /var/spool/sockets/ICE/4911
430afe00 stream 0 0 0 4d1a0d00 0 0
a5:/u/usr/merijn 104 > perl -v
This is perl, v5.8.5 built for PA-RISC2.0
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2004, Larry Wall
Enjoy, Have FUN! H.Merijn