Sponsored Content
Operating Systems HP-UX get whole command arguments in ps -ef? Post 35197 by Perderabo on Tuesday 1st of April 2003 12:37:06 PM
Old 04-01-2003
Quote:
Originally posted by nhatch
Most strange
Well, I agree with that much of your post Smilie

This is what the HP man page for ps actually has:
Code:
 NAME
      ps - report process status

 SYNOPSIS
      ps [-adeflP] [-g grplist] [-p proclist] [-R prmgrplist] [-t termlist]
      [-u uidlist]

    XPG4 Synopsis
      ps [-aAcdefHjlP] [-C cmdlist] [-g grplist] [-G gidlist] [-n namelist]
      [-o format] [-p proclist] [-R prmgrplist] [-s sidlist] [-t termlist]
      [-u uidlist] [-U uidlist]


and later...

           args           The command line given when the process was
                          created.  This column should be the last one
                          specified, if it is desired.  Only a subset of the
                          command line is saved by the kernel; as much of
                          the command line will be displayed as is
                          available.  The output in this column may contain
                          spaces.  The default heading for this column is
                          COMMAND if -o is specified and CMD otherwise.

nhatch, run the "uname -a" command and post the results.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

GREP Command with several arguments

Hi! $ more file yoyo haha lili ... i want to test if a "grep yoyo AND lili" works in this file. In fact, my script will carry on only if it finds in the same line "yoyo" AND "lili" How can i do? Thx! (3 Replies)
Discussion started by: tomapam
3 Replies

2. Programming

command line arguments

Hi How to pass multi line text as a command line argument to a program. (i.e) ./a.out hi this is sample 0 file1 where hi this is sample should be stored in argv 0 in argv and so on... (3 Replies)
Discussion started by: bankpro
3 Replies

3. UNIX for Dummies Questions & Answers

arguments in command line

Hi all, How many arguments can we pass while testing a prgm at command line.. I encountered an issue while passing 10 arguments. For $10 its taking argument passed for $1 followed by 'zero'. can we pass more than 9 arguments /Is there any other way. Thanks, rrs (6 Replies)
Discussion started by: rrs
6 Replies

4. Shell Programming and Scripting

command line arguments

-------------------------------------------------------------------------------- I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence... (1 Reply)
Discussion started by: skooly5
1 Replies

5. UNIX for Dummies Questions & Answers

Command line arguments.

I am working on a script wherein i need the user to enter the Build ID for eg:the command line will show enter the build ID Now on entering the build ID it should be assigned to @ARGV. How can this be done.? (1 Reply)
Discussion started by: Varghese
1 Replies

6. UNIX for Dummies Questions & Answers

command line arguments

hi, can someone how to accept command line arguments as a variable using in script? like: ./scriptname arguments by accept arguments, I can use it in my script? thx! (1 Reply)
Discussion started by: ikeQ
1 Replies

7. Shell Programming and Scripting

command line arguments

hi,,,, I want to create a command prompt, for example "prompt>", so my prompt need to handle commands, for example "prompt>cmd", so i want to know how to get arguments for my own commands cmd, i.e. default argc should contain arguments count and argv should point to the argument vector i.e, for... (2 Replies)
Discussion started by: vins_89
2 Replies

8. Shell Programming and Scripting

Special characters in command arguments

Hey Guys, I have a program that populates a database based on input I feed it. so it would look like: cmd arg1 arg2 ... argN Now some of the arguments have special characters in them so I wrote a small script to pull the args and wrap them in quotes ('arg'). The problem is sometimes... (10 Replies)
Discussion started by: aaron0001
10 Replies

9. Homework & Coursework Questions

Filter command arguments

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Execute command with integer list arguments such as myScript 8 7 2 3. Take those arguments and square all of... (2 Replies)
Discussion started by: Learn4Life
2 Replies

10. UNIX for Beginners Questions & Answers

Loop with command line arguments

Ubuntum, Bash version: 4.3.46 Hi, how can I create a loop where the command line arguments change (increase) and every time the number of arguments is different ? ### I have many gene names... that mean gene1=$2, gene2=$3, ...... geneN=$N+1 ### some time the number of gene is 25, other... (7 Replies)
Discussion started by: echo manolis
7 Replies
pgrep(1)							   User Commands							  pgrep(1)

NAME
pgrep, pkill - find or signal processes by name and other attributes SYNOPSIS
pgrep [-flvx] [-n | -o] [-d delim] [-P ppidlist] [-g pgrplist] [-s sidlist] [-u euidlist] [-U uidlist] [-G gidlist] [-J projidlist] [-t termlist] [-T taskidlist] [-c ctidlist] [-z zoneidlist] [pattern] pkill [-signal] [-fvx] [-n | -o] [-P ppidlist] [-g pgrplist] [-s sidlist] [-u euidlist] [-U uidlist] [-G gidlist] [-J projidlist] [-t termlist] [-T taskidlist] [-c ctidlist] [-z zoneidlist] [pattern] DESCRIPTION
The pgrep utility examines the active processes on the system and reports the process IDs of the processes whose attributes match the cri- teria specified on the command line. Each process ID is printed as a decimal value and is separated from the next ID by a delimiter string, which defaults to a newline. For each attribute option, the user can specify a set of possible values separated by commas on the command line. For example, pgrep -G other,daemon matches processes whose real group ID is other OR daemon. If multiple criteria options are specified, pgrep matches processes whose attributes match the logical AND of the criteria options. For example, pgrep -G other,daemon -U root,daemon matches processes whose attributes are: (real group ID is other OR daemon) AND (real user ID is root OR daemon) pkill functions identically to pgrep, except that each matching process is signaled as if by kill(1) instead of having its process ID printed. A signal name or number may be specified as the first command line option to pkill. OPTIONS
The following options are supported: -c ctidlist Matches only processes whose process contract ID is in the given list. -d delim Specifies the output delimiter string to be printed between each matching process ID. If no -d option is specified, the default is a newline character. The -d option is only valid when specified as an option to pgrep. -f The regular expression pattern should be matched against the full process argument string (obtained from the pr_psargs field of the /proc/nnnnn/psinfo file). If no -f option is specified, the expression is matched only against the name of the executable file (obtained from the pr_fname field of the /proc/nnnnn/psinfo file). -g pgrplist Matches only processes whose process group ID is in the given list. If group 0 is included in the list, this is inter- preted as the process group ID of the pgrep or pkill process. -G gidlist Matches only processes whose real group ID is in the given list. Each group ID may be specified as either a group name or a numerical group ID. -J projidlist Matches only processes whose project ID is in the given list. Each project ID may be specified as either a project name or a numerical project ID. -l Long output format. Prints the process name along with the process ID of each matching process. The process name is obtained from the pr_psargs or pr_fname field, depending on whether the -f option was specified (see above). The -l option is only valid when specified as an option to pgrep. -n Matches only the newest (most recently created) process that meets all other specified matching criteria. Cannot be used with option -o. -o Matches only the oldest (earliest created) process that meets all other specified matching criteria. Cannot be used with option -n. -P ppidlist Matches only processes whose parent process ID is in the given list. -s sidlist Matches only processes whose process session ID is in in the given list. If ID 0 is included in the list, this is inter- preted as the session ID of the pgrep or pkill process. -t termlist Matches only processes which are associated with a terminal in the given list. Each terminal is specified as the suffix following "/dev/" of the terminal's device path name in /dev. For example, term/a or pts/0. -T taskidlist Matches only processes whose task ID is in the given list. If ID 0 is included in the list, this is interpreted as the task ID of the pgrep or pkill process. -u euidlist Matches only processes whose effective user ID is in the given list. Each user ID may be specified as either a login name or a numerical user ID. -U uidlist Matches only processes whose real user ID is in the given list. Each user ID may be specified as either a login name or a numerical user ID. -v Reverses the sense of the matching. Matches all processes except those which meet the specified matching criteria. -x Considers only processes whose argument string or executable file name exactly matches the specified pattern to be match- ing processes. The pattern match is considered to be exact when all characters in the process argument string or exe- cutable file name match the pattern. -z zoneidlist Matches only processes whose zone ID is in the given list. Each zone ID may be specified as either a zone name or a numer- ical zone ID. This option is only useful when executed in the global zone. If the pkill utility is used to send signals to processes in other zones, the process must have asserted the {PRIV_PROC_ZONE} privilege (see privileges(5)). -signal Specifies the signal to send to each matched process. If no signal is specified, SIGTERM is sent by default. The value of signal can be one of the symbolic names defined in signal.h(3HEAD) without the SIG prefix, or the corresponding signal number as a decimal value. The -signal option is only valid when specified as the first option to pkill. OPERANDS
The following operand is supported: pattern Specifies an Extended Regular Expression (ERE) pattern to match against either the executable file name or full process argument string. See regex(5) for a complete description of the ERE syntax. EXAMPLES
Example 1 Obtaining a Process ID Obtain the process ID of sendmail: example% pgrep -x -u root sendmail 283 Example 2 Terminating a Process Terminate the most recently created xterm: example% pkill -n xterm EXIT STATUS
The following exit values are returned: 0 One or more processes were matched. 1 No processes were matched. 2 Invalid command line options were specified. 3 A fatal error occurred. FILES
/proc/nnnnn/psinfo Process information files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
kill(1), proc(1), ps(1), truss(1), kill(2), signal.h(3HEAD), proc(4), attributes(5), privileges(5), regex(5), zones(5) NOTES
Both utilities match the ERE pattern argument against either the pr_fname or pr_psargs fields of the /proc/nnnnn/psinfo files. The lengths of these strings are limited according to definitions in <sys/procfs.h>. Patterns which can match strings longer than the current limits may fail to match the intended set of processes. If the pattern argument contains ERE meta-characters which are also shell meta-characters, it may be necessary to enclose the pattern with appropriate shell quotes. Defunct processes are never matched by either pgrep or pkill. The current pgrep or pkill process will never consider itself a potential match. SunOS 5.11 6 May 2004 pgrep(1)
All times are GMT -4. The time now is 01:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy