In the Unix-like world there are several type of styles for ps. Some systems support the BSD style where no `-' is prefixed, some systems support the POSIX or UNIX standards where a prefixed `-' is required. Most Linux systems has the GNU style as well, called long options, which does not affect here, nevertheless, because the GNU ps tries to accommodate all three styles, and mix and match is allowed, conflicts do occur. -u and u has the greatest chance of conflicting with other flags because they mean different in each style.
Try this one and see if it does what you want.
args is a valid user-defined format specifier. Meaning that you use with the -o or o prefixed in front and space is allow.
Some of the others specifiers are:
Interesting enough cmd, args and command are alias.
I ask this question since sometimes i run a time-consuming ftp in foreground and forget to use nohup ftp.sh & to put this work background and can still running after i log off.
Assume this ftp task have run 1 hour, and still 1 hour time to end,
i don't want to abort the ftp, first, i use ctrl+Z... (3 Replies)
Hi All,
The scenario is like this:
There is a process say "A" which create a child process say "B" if some condition is true and process "A" terminates. "B" invokes some C program say "C" using 'execl' function. The job of program "C" is to keep polling the server until the server will be up.... (2 Replies)
hi
what is the shell programming code to know the number of processes currently running on the machine & information about those processes.
Another one is the configuration and usage of the UNIX file system?
requesting all for help.
thanks (1 Reply)
When I typed in ps -a I get this:
PID TTY TIME CMD
31799 pts/3 00:00:00 vim
31866 pts/3 00:00:00 vim
And to check who is currently logged in, I type who
Felix Whoals
Tada Whoals
Lala Whoals
How can I get the user process for all current users who logged in?? I think I need to combine... (14 Replies)
Hi all,
When I issued command ps -ef|grep Vinay in a UNIX machine,
I got the following
Vinay 22491 1 255 Jun 18 ? 294248:53 -sh
Vinay 26628 1 255 Jun 18 ? 294237:33 -sh
Could you tell me what all process is running ? Please explain each of the fields.
Thanks... (4 Replies)
I have been having some trouble trying to get some code working, so I was wondering...what system calls are required to execute a different program from an already running process? (1 Reply)
I'm trying to create a ksh script to do the following:
1) Ask the user what process they want to search for.
2) Have the script read the input as a variable and use it to search for the process.
3) Display the current time & date, the working directory of the process, and finally display the... (6 Replies)
All,
1.What is the unix comand used for all current running process (Including All current running processes Parent ->child->subchild process)
2.If child and subchild processes are running then what is the unix command to kill parent and its all child subchild processes in UNIX.
Kindly... (7 Replies)
Discussion started by: skp
7 Replies
LEARN ABOUT HPUX
vsnprintf
vprintf(3S)vprintf(3S)NAME
vprintf(), vfprintf(), vsprintf(), vsnprintf() - print formatted output of a varargs argument list
SYNOPSIS DESCRIPTION
and are the same as and respectively, except that instead of being called with a variable number of arguments, they are called with an
argument list as defined by
RETURN VALUE
Each function returns the number of bytes transmitted (excluding the null byte character in the case of or a negative value if an output
error was encountered.
By default, returns a negative value if maxsize is smaller than the number of characters formatted. In the UNIX 2003 standards environment
(see standards(5)) it returns the number of bytes that would have been written to buffer s, excluding the terminating null byte, if maxsize
had been sufficiently large.
EXAMPLES
The following demonstrates how could be used to write an error routine:
#include <stdarg.h>
#include <stdio.h>
.
.
.
/*
* error should be called using the form:
* error(function_name, format, arg1, arg2...);
*/
/*VARARGS0*/
void
error(va_alist)
va_dcl
{
va_list args;
char *fmt;
va_start(args);
/* print out name of function causing error */
(void)fprintf(stderr, "ERROR in %s: ", va_arg(args, char *));
fmt = va_arg(args, char *);
/* print out remainder of message */
(void)vfprintf(stderr, fmt, args);
va_end(args);
(void)abort( );
}
SEE ALSO setlocale(3C), printf(3S), standards(5), thread_safety(5), varargs(5), glossary(9).
STANDARDS CONFORMANCE vprintf(3S)