Re: Problem with netstat -p
- From: Germán <germanwani@xxxxxxxxx>
- Date: Mon, 19 May 2008 08:46:47 -0700 (PDT)
Thank you very much. Now I know, after searching for that "2>", that
is the way to redirect the STDERR.
Thanks again,
Germán.
On 19 mayo, 06:40, mop2 <mop2bky4mz5tyjwa8ersp7hrg5u...@xxxxxxxxx>
wrote:
Germán wrote:
Hi all, I'm having a problem using netstat -tap in a Bash Script. I
need to grep for sockets of the current user, in the current terminal
and that are ESTABLISHED. For them I need their associated process PID
to kill the processes after that, so I use -p. Well, the problem comes
because I'm not root and every time I use netstat with -p in the
script, it prints in the screen the annoying message (Not all
processes could be identified, non-owned process info will not be
shown, you would have to be root to see it all.).
I don't need to be root because I only want to see the processes of
the current user and it's working fine because it shows them. But, I
don't know how to hide that message that is appearing always in
STDOUT. I tried redirecting the output to a file, to /dev/null,
running it in background, etc. and it is always showed. I looked in
the man page of netstat, but I didn't find any way to hide that
warning.
Thank you in advance and I hope you can help me with this.
I think you need this:
netstat -p 2>/dev/null- Ocultar texto de la cita -
- Mostrar texto de la cita -
.
- References:
- Problem with netstat -p
- From: Germán
- Problem with netstat -p
- Prev by Date: Re: Ksh problem edit file
- Next by Date: Re: How to do nothing when "for i in *" runs in empty directory?
- Previous by thread: Problem with netstat -p
- Next by thread: String replacement script
- Index(es):
Relevant Pages
|