The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Catching ctrl-C or ctrl-D sendhilmani123 Shell Programming and Scripting 2 05-02-2006 06:02 PM
how to enable Ctrl + C in ksh dradhzn Shell Programming and Scripting 0 05-01-2006 11:32 PM
Disable ctrl-c,ctrl-d,ctrl-d in ksh script wtofu AIX 6 06-29-2005 05:41 PM
my ctrl+c doesn't work yankee428 UNIX for Dummies Questions & Answers 3 06-02-2005 02:35 PM
Script ctrl+c newtounix UNIX for Dummies Questions & Answers 1 03-19-2001 05:23 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-30-2008
RahulJoshi's Avatar
RahulJoshi RahulJoshi is offline
Registered User
  
 

Join Date: Aug 2008
Location: PUNE
Posts: 98
stoped job using ctrl+z now want to run in nohup

once i have stoped process by ctrl+z then i want to run it again
in nohup plz help me out.
  #2 (permalink)  
Old 08-31-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,419
when you press ctrl+z you will get PID
then run
Quote:
nohup -p PID
  #3 (permalink)  
Old 08-31-2008
RahulJoshi's Avatar
RahulJoshi RahulJoshi is offline
Registered User
  
 

Join Date: Aug 2008
Location: PUNE
Posts: 98
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.
  #4 (permalink)  
Old 08-31-2008
buffoonix buffoonix is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 145
Quote:
nohup -p PID
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

Code:
$ 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:

Code:
       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.

  #5 (permalink)  
Old 09-01-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,419
Quote:
Originally Posted by RahulJoshi View Post
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.
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..
  #6 (permalink)  
Old 09-01-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,419
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
  #7 (permalink)  
Old 09-01-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
As remarked recently in another thread, nohup -p appears to be an AIX-only thing.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0