Sponsored Content
Operating Systems Solaris How to avoid truncating in ps output ? Post 303016482 by solaris_1977 on Friday 27th of April 2018 02:29:02 PM
Old 04-27-2018
How to avoid truncating in ps output ?

Hello,
This is Solaris 10 (x86)
Code:
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 2009
bash-3.2#

I am not able to figure out, how to avoid trucating in ps output. I want full path, but is is cutting lines in the last. Even if I redirect output to a file, it is same.
I tried multiple ways, but still same
Code:
bash-3.2# /usr/ucb/ps -wwwwwaux | grep syslog-ng | egrep -v grep
root     13862  1.6  0.1 8420 4388 ?        S   Apr 11 330:37 /usr/local/sbin/syslog-ng --cfgfile /logs/c720/syslog-ng.conf --pidfile /var/ru
root     21187  0.1  0.1 7756 3728 ?        S   Apr 13 100:51 /usr/local/sbin/syslog-ng --cfgfile /logs/neteng/syslog-ng.conf --pidfile /var/
root      4804  0.0  0.0 6404 1432 ?        S   Apr 25  0:00 /usr/local/sbin/syslog-ng --cfgfile /etc/syslog-ng.conf --pidfile /var/run/sysl
root      4805  0.0  0.0 6404 1432 ?        S   Apr 25  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/test/syslog-ng.conf --pidfile /var/ru
root      4806  0.0  0.1 6800 2812 ?        S   Apr 25  0:00 /usr/local/sbin/syslog-ng --cfgfile /etc/syslog-ng.conf --pidfile /var/run/sysl
root      4807  0.0  0.1 6828 2796 ?        S   Apr 25  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/test/syslog-ng.conf --pidfile /var/ru
root     10595  0.0  0.0 6404 1432 ?        S   Sep 24  0:00 /usr/local/sbin/syslog-ng --cfgfile /etc/syslog-ng.conf --pidfile /var/run/sysl
root     10596  0.0  0.1 8376 4380 ?        S   Sep 24  0:08 /usr/local/sbin/syslog-ng --cfgfile /etc/syslog-ng.conf --pidfile /var/run/sysl
root     13844  0.0  0.0 6404 1432 ?        S   Apr 11  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/nss/syslog-ng.conf --pidfile /var/run
root     13845  0.0  0.1 8212 4184 ?        S   Apr 11  0:02 /usr/local/sbin/syslog-ng --cfgfile /logs/nss/syslog-ng.conf --pidfile /var/run
root     13858  0.0  0.0 6404 1432 ?        S   Apr 11  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/lbs/syslog-ng.conf --pidfile /var/run
root     13859  0.0  0.1 8228 4200 ?        S   Apr 11  0:02 /usr/local/sbin/syslog-ng --cfgfile /logs/lbs/syslog-ng.conf --pidfile /var/run
root     13861  0.0  0.0 6404 1432 ?        S   Apr 11  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/c720/syslog-ng.conf --pidfile /var/ru
root     13894  0.0  0.0 6404 1432 ?        S   Apr 11  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/sbsd/syslog-ng.conf --pidfile /var/ru
root     13896  0.0  0.1 8428 4380 ?        S   Apr 11  1:15 /usr/local/sbin/syslog-ng --cfgfile /logs/sbsd/syslog-ng.conf --pidfile /var/ru
root     13897  0.0  0.0 6404 1432 ?        S   Apr 11  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/v720/syslog-ng.conf --pidfile /var/ru
root     13898  0.0  0.1 8332 4304 ?        S   Apr 11  1:14 /usr/local/sbin/syslog-ng --cfgfile /logs/v720/syslog-ng.conf --pidfile /var/ru
root     13906  0.0  0.0 6404 1432 ?        S   Apr 11  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/wks/syslog-ng.conf --pidfile /var/run
root     13907  0.0  0.1 8228 4200 ?        S   Apr 11  0:02 /usr/local/sbin/syslog-ng --cfgfile /logs/wks/syslog-ng.conf --pidfile /var/run
root     13936  0.0  0.0 6404 1432 ?        S   Apr 11  0:00 /usr/local/sbin/syslog-ng --cfgfile /etc/syslog-ng.conf --pidfile /var/run/sysl
root     13937  0.0  0.1 6864 2876 ?        S   Apr 11  0:00 /usr/local/sbin/syslog-ng --cfgfile /etc/syslog-ng.conf --pidfile /var/run/sysl
root     18153  0.0  0.0 6404 1432 ?        S   Jul 18  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/ng720/syslog-ng.conf --pidfile /var/r
root     18154  0.0  0.23867634604 ?        S   Jul 18  9:46 /usr/local/sbin/syslog-ng --cfgfile /logs/ng720/syslog-ng.conf --pidfile /var/r
root     21186  0.0  0.0 6404 1432 ?        S   Apr 13  0:00 /usr/local/sbin/syslog-ng --cfgfile /logs/neteng/syslog-ng.conf --pidfile /var/
bash-3.2# which ps
/usr/bin/ps
bash-3.2# /usr/bin/ps -wwwwwaux | grep syslog-ng | egrep -v grep
/usr/bin/ps: illegal option -- w
/usr/bin/ps: illegal option -- w
/usr/bin/ps: illegal option -- w
/usr/bin/ps: illegal option -- w
/usr/bin/ps: illegal option -- w
usage: ps [ -aAdeflcjLPyZ ] [ -o format ] [ -t termlist ]
        [ -u userlist ] [ -U userlist ] [ -G grouplist ]
        [ -p proclist ] [ -g pgrplist ] [ -s sidlist ] [ -z zonelist ]
  'format' is one or more of:
        user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid ctid
        pri opri pcpu pmem vsz rss osz nice class time etime stime zone zoneid
        f s c lwp nlwp psr tty addr wchan fname comm args projid project pset
bash-3.2#

Please suggest the correct way
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can I avoid the standard output from kill command

I am sending a kill comand to kill a process inside a SH script but I don`t want the user to notice it so I donīt want the message "1222 killed" to appear. I`ve tried to redirect the standard output to /dev/null 2>&1 and also tried to use "nohup" but none of them was succesfull. Can anyone... (1 Reply)
Discussion started by: pguinal
1 Replies

2. UNIX for Dummies Questions & Answers

`ps` command truncating text

I have some processes that show a long file path as part of the process name and the process name gets truncated off. Does anyone know how to get the full output from the `ps`command so that I can see the whole process name? (9 Replies)
Discussion started by: keelba
9 Replies

3. 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

4. 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

5. UNIX for Dummies Questions & Answers

how to avoid time command output

Hi, I have 2 queries 1 .when I run some unix command, I am getting the output of "time" at std output (screen) for eg zegrep <pattern> *.v.gz I almost found the reason but not sure, if the no of files matching *.v.gz is more then I am getting the time command output at the... (5 Replies)
Discussion started by: selvaka
5 Replies

6. Shell Programming and Scripting

How to avoid the truncating of multiple spaces into a single space while reading a line from a file?

consider the small piece of code while read line do echo $line done < example content of example file sadasdasdasdsa erwerewrwr ergdgdfgf rgerg erwererwr the output is like sadasdasdasdsa erwerewrwr ergdgdfgf rgerg erwererwr the... (4 Replies)
Discussion started by: Kesavan
4 Replies

7. Shell Programming and Scripting

how to avoid cron job output to send to the junk email folder?

Hi i created a cron job which invoke a shell script and output some content via email. Some times these output are sent to the junk email folder. i want these mails to be sent to inbox with some specific font. what i have to do? (4 Replies)
Discussion started by: vidhyaS
4 Replies

8. 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

9. Shell Programming and Scripting

Avoid single line output from function

I am new to shell scripting and wished to get few things clarified. While calling functions within shell script, output comes out as single line irrespective of the no of echos or newlines I tried within function + the echo -e used to invoke function ( as instructed online) : #!/bin/sh inc() {... (1 Reply)
Discussion started by: RMath
1 Replies

10. 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
All times are GMT -4. The time now is 01:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy