Alan Mead wrote:
> I have a perl script. To make sure it is running, I do a 'ps aux' and see
> something like on my screen:
>
> [amead@hera amead]$ ps aux
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> root 1 0.0 0.1 1104 72 ? S Jul05 5:50 init [3]
> ..
> root 22461 0.1 3.0 2840 1904 pts/1 S 13:07 0:01 perl -w
> /usr/sbin/sendreports
> ..
>
> But if I try to pipe the output into grep looking for 'sendreports' I get
> nothing. If I grep for perl, I get part of the command line:
>
> [amead@hera amead]$ ps aux | grep -i sendreport
> [amead@hera amead]$ ps aux | grep -i perl
> root 22461 0.1 3.0 2840 1904 pts/1 S 13:07 0:01 perl -w
> /usr/sbin
> amead 22570 0.0 0.6 1164 428 pts/2 S 13:28 0:00 grep -i perl
>
> Why does ps truncate it's output?
>
> The -w option does give the complete width but I'm curious why the output
> varies between depending on whether it's going to the screen to a pipe. I
> sense the possibility that I could learn something here...
>
> -Alan
Default to 80 if there is no terminal to talk to.
try ps -auxww |grep sendreports
(one w for each additional 80 chars you need) also ps ax works if you are not
worried about the user stuff. alot of times the line is short enough to get
caught in the first 80 chars.
Hope this helps,
Bret
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list