Sponsored Content
Operating Systems Solaris How to avoid truncating in ps output ? Post 303016501 by solaris_1977 on Friday 27th of April 2018 04:59:03 PM
Old 04-27-2018
Seems like, this also doesn't work. Am I running it correctly ?
Code:
bash-3.2# /usr/ucb/ps wwwaux | grep syslog-ng | egrep -v grep | head -2
root     13862  0.3  0.1 8428 4528 ?        S   Apr 11 337:37 /usr/local/sbin/syslog-ng --cfgfile /logs/c911/syslog-ng.conf --pidfile /var/ru
root     21187  0.1  0.1 7764 3868 ?        S   Apr 13 101:39 /usr/local/sbin/syslog-ng --cfgfile /logs/neteng/syslog-ng.conf --pidfile /var/
bash-3.2#
bash-3.2# /usr/bin/ps -eo pid= -o comm= | awk '$2~/syslog-ng/ { print $1 }' | xargs -l pargs | head
13897:  /usr/local/sbin/syslog-ng --cfgfile /logs/v911/syslog-ng.conf --pidfile /var/ru
argv[0]: supervising syslog-ng
argv[1]: <NULL>
argv[2]: <NULL>
argv[3]: <NULL>
argv[4]: <NULL>
13859:  /usr/local/sbin/syslog-ng --cfgfile /logs/lbs/syslog-ng.conf --pidfile /var/run
argv[0]: /usr/local/sbin/syslog-ng
argv[1]: <NULL>
argv[2]: <NULL>
xargs: Child killed with signal 13
bash-3.2#
bash-3.2# /usr/bin/ps -eo pid= -o args= | awk '$2~/syslog[-]ng/ { print $1 }' | xargs -l pargs | head
13897:  /usr/local/sbin/syslog-ng --cfgfile /logs/v911/syslog-ng.conf --pidfile /var/ru
argv[0]: supervising syslog-ng
argv[1]: <NULL>
argv[2]: <NULL>
argv[3]: <NULL>
argv[4]: <NULL>
13859:  /usr/local/sbin/syslog-ng --cfgfile /logs/lbs/syslog-ng.conf --pidfile /var/run
argv[0]: /usr/local/sbin/syslog-ng
argv[1]: <NULL>
argv[2]: <NULL>
xargs: Child killed with signal 13
bash-3.2#

 

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
fasthalt(8)						      System Manager's Manual						       fasthalt(8)

NAME
fasthalt - Halts the system SYNOPSIS
/usr/sbin/fasthalt [-lnq] DESCRIPTION
The fasthalt command halts the system and flags a subsequent reboot to skip the execution of fsck. The program creates the fastboot file, then invokes the halt program. The system start-up script contains instructions to look for the fastboot file. If present, the script removes the file and skips the invocation of the fsck command. If the command is invoked without the -l, -n, or -q flag, the halt program logs the shutdown using the syslogd command and places a record of the shutdown in the login accounting file, /var/adm/wtmp. Using the -q and the -n flags imply the -l flag. You must have root privileges to use this command. FLAGS
Does not log the halt using syslog. Prevents the sync before stopping, and does not log the halt using syslog. Causes a quick halt, does not log the halt using syslog, and makes no attempt to kill all processes. FILES
Specifies the command path Specifies the path of the syslog daemon RELATED INFORMATION
Commands: fsck(8), halt(8), syslogd(8) Functions: sync(2), syslog(3) delim off fasthalt(8)
All times are GMT -4. The time now is 04:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy