The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-04-2006
fredy fredy is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 14
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
  #2 (permalink)  
Old 12-04-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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."
  #3 (permalink)  
Old 12-04-2006
fredy fredy is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 14
Man pages doesn't help

when running with the w option, the output returns to be 80 chars even if the stty is bigger then 80

BTW, i have this problem is on sun5.9 and 5.10
  #4 (permalink)  
Old 12-04-2006
Darwin_ Darwin_ is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 23
# /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 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa

that works great for me on:

SunOS aiea 5.10 Generic_118822-25 sun4u sparc SUNW,Sun-Blade-1000

cheers,
Darwin
  #5 (permalink)  
Old 12-04-2006
fredy fredy is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 14
Smile can the problem be in the terminal configuration?

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
  #6 (permalink)  
Old 12-04-2006
Darwin_ Darwin_ is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 23
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0