C program to make an exact copy of the current process in Ubundu
Hi All,
I am new to Linux and i need your for a program which makes the exact copy of the running process. I have got some codes but it only works for the first command and will not work for subsequent commands. Means it works for "ps" but will not work for "ps u". I have changed the code to accept the whole string but still the output for two word commands are not appearing. Hope some one can give me a help. My codes are below.
Last edited by radoulov; 05-01-2010 at 07:21 PM..
Reason: Code tags, please!
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 Gurus,
I have two processes running on a Unix box, named say, PRCS1 and PRCS1X.
I want to check whether process PRCS1 is running or not, and depending on that I have to make further decisions while writing a shell script.
I am using: ps -eaf|grep PRCS1|grep -v grep
But the... (2 Replies)
Hi All,
I have two ksh script. 1st script calls the 2nd script and the second script calls an 'C' program.
I want 1st script to wait until the 'C' program completes.
I cant able to get the process id for the 'C' program (child process) to make the 1st script to wait for the second... (7 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 am working on one script where I need to grep the exact process in perl script.
for e.g. when I run simple grep command on the linux machine it gives me two process mGateway_mvc_q01 and mGateway_mvc_q01_v7 which is not the correct result.I tried to use ( ps -eAf | grep ^mGateway_mvc_q01$) but... (1 Reply)
Hi,
I have written a menu driven shell script in which as per the choice, I run the another script on background.
For eg:
1. get info
2)process info
3)modify info
All the operations have different scripts which i schedule in background using &.
However I wish to display the error... (0 Replies)
To Solaris 8 Experts,
Please let me know what's the best method / procedure as well as the Solaris 8 commands for accomplishing the following tasks on a production Sun Enterprise 250 Server running Sun Solaris 8 Operating System:
1. Make an exact image/copy of the SCSI Hard Drive in the... (3 Replies)
Team,
I have multiple batchjobs running in VM, if I do ps -ef |grep java or tomcat I am getting multiple process list.
How do I get my exact tomcat process running and that is unique? via shell script? (4 Replies)
Please do not post a technical question in the @How to contact....' forum. I have moved this for you.
Hello Everyone,
Please help me on this,
Requirement here is to check whether the process is running using the process id.
For the below scenario, I m trying to grep 1750 process id to... (3 Replies)
Discussion started by: Hari A
3 Replies
LEARN ABOUT HPUX
timex
timex(1) General Commands Manual timex(1)NAME
timex - time a command; report process data and system activity
SYNOPSIS
command
DESCRIPTION
reports in seconds the elapsed time, user time, and system time spent in execution of the given command. Optionally, process accounting
data for command and all its children can be listed or summarized, and total system activity during the execution interval can be reported.
The output of is written on the standard error. Timex returns an exit status of 1 if it is used incorrectly, if it is unable to fork, or if
it could not exec command . Otherwise, timex returns the exit status of command.
Options
Report the total number of blocks read or written and
total characters transferred by command and all its children. This option works only if the process accounting soft-
ware is installed.
List process accounting records for
command and all its children. The suboptions and modify the data items reported. They behave as defined in acct-
com(1M). The number of blocks read or written and the number of characters transferred are always reported.
This option works only if the process accounting software is installed and has been invoked to create
Report total system activity (not just that due to
command) that occurred during the execution interval of command. All the data items listed in sar(1M) are reported.
EXAMPLES
A simple example:
A terminal session of arbitrary complexity can be measured by timing a sub-shell:
session commands
EOT
WARNINGS
Process records associated with command are selected from the accounting file by inference, since process genealogy is not available.
Background processes having the same user-ID, terminal-ID, and execution time window are spuriously included.
SEE ALSO sar(1M), acctcom(1M).
STANDARDS CONFORMANCE timex(1)