`ps` command truncating text


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers `ps` command truncating text
# 8  
Old 09-27-2002
I don't think the ps that is shipped with HP-UX will understand BSD-style options, but in case I'm wrong, try:
ps auw

Also, it may understand the Unix98 (I think) ps options:
ps -efw

And just to refresh my memory, HP-UX 11 doesn't use the /proc filesystem, does it? If I'm mistaken, and it actually does, try :
ll /proc/(pid#)/exe
# 9  
Old 09-28-2002
Try

ps eww <process number>

It'll give you the full command and the environment variables
when the process was created

GOOD LUCK
# 10  
Old 09-28-2002
HP-UX, at present, can support UNIX95 but not UNIX98. And UNIX98 does not support a -w option to ps anyway. To verify that I followed the link that Neo added to the standard. The language is very interesting...
Quote:
args The command with all its arguments as a string. The implementation may truncate this value to the field width; it is implementation-defined whether any further truncation occurs. It is unspecified whether the string represented is a version of the argument list as it was passed to the command when it started, or is a version of the arguments as they may have been modified by the application. Applications cannot depend on being able to modify their argument list and having that modification be reflected in the output of ps.
And later...
Quote:
It is recognized that on some implementations, especially multi-level secure systems, ps may be nearly useless.
HP, for better or worse, wanted to be able to obtain a high security rating for HP-UX. Their B level version of HP-UX is a different product, but it shares much code with plain old HP-UX. Not only does HP's ps have no way of displaying the environment variables of other processes, but there is no way to do that under HP-UX. The only reason that ps has any shot of displaying the command line is that the kernel saves a copy of the command as it exec()'s a process. But the area where it is saved is only 64 bytes. There is no hope of writing a version of ps that displays more than that on HP-UX short of modifying the kernel to save more of the command line.

I'm not sure what "ll /proc/$pid/exe" is supposed to do. But there is no standard for what a /proc filesystem contains. On SunOS, I went to a /proc entry and did an ls. I got:
Code:
as        ctl       lpsinfo   lwp       pagedata  root      usage
auxv      cwd       lstatus   map       psinfo    sigact    watch
cred      fd        lusage    object    rmap      status    xmap

And none of those files is ascii data that be simply printed out. But HP-UX has no /proc filesystem anyway.

Sorry for the bad news, folks. But there are some differences among the various versions of UNIX. You can't take everything you know about your own version of UNIX and assume that it will work everywhere.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sendmail command truncating to list

Hey Folks - I'm trying to pass a list of To address using sendmail command but upon executing the script the to list gets truncated and not able to send the last sender : -bash-4.3$ ./akt.sh Date : 03-JUL-18 aaaaa.sss#bgttecre.bom trcikant.shrivas#bgttecre.bom abc#xyz.bom pqr#lmn.bom lion... (0 Replies)
Discussion started by: vyomdev
0 Replies

2. Solaris

How to avoid truncating in ps output ?

Hello, This is Solaris 10 (x86) bash-3.2# cat /etc/release Solaris 10 5/09 s10x_u7wos_08 X86 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 30 March... (5 Replies)
Discussion started by: solaris_1977
5 Replies

3. UNIX for Dummies Questions & Answers

awk truncating first field output?

Hello, I'm writing an Awk script to take a command line argument (student's name) and output their relevant student#, name, and marks. For some reason, awk arbitrarily removes the first digit from the student number and doesn't show me the proper output. Here is my code: #! /usr/bin/awk -f... (6 Replies)
Discussion started by: trashmouth12
6 Replies

4. Shell Programming and Scripting

nawk is truncating output

Legends, I have 2 files f1 and f2. when i use nawk to compare the difference(subtraction) from 4th column of the file, it truncates the output. can you please help to resolve this. subtraction is (4th col of f1 - 4th col of f2). but it gives only below lines out of 116. I want to print all... (7 Replies)
Discussion started by: sdosanjh
7 Replies

5. Shell Programming and Scripting

plink truncating commands

I'm using plink.exe on WinXP to run some commands on Z/OS BASH. My commands are interspersed with echo commands so that I can parse the output and work out what is where. The first hundred or so commands run fine, but then one of them gets truncated. For example: Input: echo :end_logdetail:... (6 Replies)
Discussion started by: PhilHibbs
6 Replies

6. Shell Programming and Scripting

Truncating a mail file

Hi, I have a Unix mail file that I need to truncate, based on the date of the messages. For those not familiar with the format, it is a single file for each user, with the first line of the mail message looking like the following: From user@sitename.com Thu Apr 21 05:40:33 2011 Each... (3 Replies)
Discussion started by: joed
3 Replies

7. UNIX for Dummies Questions & Answers

Truncating file based on date

Hi, I need to truncate a file based on date.Suppose i have a log file which is getting updated every date,i need to keep 7 days worth of data(like sysdate-7) and rest i want to truncate it.Can some help me? (5 Replies)
Discussion started by: Param0073
5 Replies

8. UNIX for Dummies Questions & Answers

Truncating the last character

Hi all , I am creating the file which holds the create query to run in the sql prompt: so when i am creating: create table XXX( SD Varchar2(10), DF Varchar2(10),) I am getting one comma at the last ,before i am inserting the closing bracket i need to delete that? kindly provide me the... (1 Reply)
Discussion started by: ithirak17
1 Replies

9. Shell Programming and Scripting

Truncating a variable

I have a variable that is a full path name and I just want the file name with out the extension. I have figured out how to do this using some temp files but I would really like to avoid that if possible. I know I can do echo ${TMPNAME%.*} to drop the extension is there a similar way to drop... (3 Replies)
Discussion started by: whdr02
3 Replies

10. UNIX for Dummies Questions & Answers

Truncating a number using sed/awk

Hi all, I'm trying to truncate a number like the following: 0001060407013900501048239559900600504083525826350002050354795057 I would like to create an output which puts carriage returns every so many characters, giving an output such as: 0001 060407 0139 0 05 010482395599 0060... (4 Replies)
Discussion started by: michaeltravisuk
4 Replies
Login or Register to Ask a Question