![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Redirection of output (for logging) | _Spare_Ribs_ | Shell Programming and Scripting | 3 | 12-04-2006 02:17 PM |
| Asking about shell script input output redirection | trivektor | Shell Programming and Scripting | 1 | 10-18-2006 01:13 AM |
| redirection of ladebug output | yakari | UNIX for Advanced & Expert Users | 2 | 10-06-2006 02:23 AM |
| Standard output and redirection | jerardfjay | Shell Programming and Scripting | 2 | 06-27-2005 11:03 AM |
| Bash multiple output redirection | yoi2hot4ya | Shell Programming and Scripting | 2 | 05-31-2005 12:52 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
who truncates the output? redirection? tty? Bug?
Hi,
Output of running berkeley ps is truncated to 80 chars when using redirections. $ /usr/ucb/ps -e 12490|cat #truncated to 80 chars PID TT S TIME COMMAND 12490 pts/24 S 0:00 sleep 4000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa getting longer lines is done by changing the stty $ stty columns 300 $ /usr/ucb/ps -e 12490 PID TT S TIME COMMAND 12490 pts/24 S 0:00 sleep 4000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...#line is 300 char when running with redirection and trying to get the same result by environment variables $ set COLUMNS=300;export COLUMNS $ echo $COLUMNS 300 $ /usr/ucb/ps -e 12490|cat #truncated to 80 chars PID TT S TIME COMMAND 12490 pts/24 S 0:00 sleep 4000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa another option i tried is by setting the output in a variable (still not working): $output=`/usr/ucb/ps -e 12490` $echo $output PID TT S TIME COMMAND 12490 pts/24 S 0:00 sleep 4000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Does some knows how to overcome this problem? How can i know what is the max size the stty columns can be define? I have noticed that setting the stty columns higher the the length of the command and arguments (ps -e) the ps "command" line shows only the process name in brackets e.g. [java]. Thats why i am looking for the max size of the command and args. Thanks in advance |
|
|||||
|
Maybe you should try reading the man page? It has stuff like:
"w Use a wide output format (132 columns rather than 80); if repeated, that is, -ww, use arbitrarily wide output. This information is used to decide how much of long commands to print." |
|
||||
|
# /usr/ucb/ps auxwww | grep sleep
root 13628 0.0 0.1 1216 944 pts/5 S 16:07:44 0:00 sleep 8000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa that works great for me on: SunOS aiea 5.10 Generic_118822-25 sun4u sparc SUNW,Sun-Blade-1000 cheers, Darwin |
|
||||
|
Hi,
Thanks for the answer. 1. what is your configuration of the stty [columns] (stty -a)? 2. what happens if you set the stty columns size bigger the the command line? does the command comes with brackets? Do you know if there is a way to avoid that? 3. Is there any COLUMNS environment variable defined? Many questions ... i appritiate it. Thanks again, Fredy |
|
||||
|
My column size is 80 and there is no environment variable setting it to something different. However, ps auxwww still shows me the entire command line of the process. (Whats a very useful feature when having a look at java processes ;-))
Did you ever try ps auxwww (with 3 w) ? This should work regardless of any column size settings when using the /usr/ucb/ps exec, afaik. cheers, Darwin |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|