once i have stoped process by ctrl+z then i want to run it again
in nohup plz help me out.
when you press ctrl+z you will get PID
then run
vidhyadhar pso,
I have already check it its not work
and what work is:
nohup `fg %<jobs_id>`
but i want some command which also work for "sleep 100" type of cmd.
I haven't yet come across an implementation of nohup which knows a -p option.
But then I don't know every flavour of Unix.
Usually nohup is only executed on startup of a command given as argument but cannot attach to a running process.
If you are running your job control in Bash then you could use the built-in disown command like
$ echo $0
bash
$ sleep 600 &
[1] 5764
$ disown -h %1
Now you should be able to logout without the shell sending a SIGHUP to your disowned sleep job.
May I refer you to man bash:
disown [-ar] [-h] [jobspec ...]
Without options, each jobspec is removed from the table of
active jobs. If the -h option is given, each jobspec is not
removed from the table, but is marked so that SIGHUP is not sent
to the job if the shell receives a SIGHUP. If no jobspec is
present, and neither the -a nor the -r option is supplied, the
current job is used. If no jobspec is supplied, the -a option
means to remove or mark all jobs; the -r option without a job
spec argument restricts operation to running jobs. The return
value is 0 unless a jobspec does not specify a valid job.
rahul if you observe carefully in AIX type man page for nohup its written clearly..
you can't say whats written in man page is wrong..
you might be doing it wrong.. somethigs are done only by experts..
here is the proc..
sleep 100
ctrl+z
[1] + Stopped (SIGTSTP) sleep 100
ps
PID TTY TIME CMD
598132 pts/3 0:00 sleep 100
2060484 pts/3 0:00 -ksh
2347048 pts/3 0:00 ps
2449582 pts/3 0:00 -ksh
3076200 pts/3 0:00 -ksh
nohup -p 598132
fg %1 or bg %1
if this won't work change the OS
As remarked recently in another thread, nohup -p appears to be an AIX-only thing.