- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to switch to a process in the background?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2002 01:52 PM
тАО11-27-2002 01:52 PM
but I think sometimes this is not a good idea. The problem for me is I through the process of fbackup command during my normal full backup to the system. Then, when the system request for a second tape, I didn't know how to switch back to fbackup process and type y to continue with the backup?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2002 01:55 PM
тАО11-27-2002 01:55 PM
Re: How to switch to a process in the background?
If you kick off a script or command something like this:
dosomething [some options] &
you should be able to get back to it by doing:
fg
and then answer your prompt.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2002 02:00 PM
тАО11-27-2002 02:00 PM
SolutionPresuming you are using the posix shell, do "man sh-posix" and look at the section "Jobs".
You can reference background processes several ways. Normally, I use the %number method. You can use the "jobs" command and then "fg %number" to bring a process back to the foreground.
Here's a very simple example:
$ sleep 120&
[1] 5600
$ sleep 60&
[2] 5601
$ sleep 30&
[3] 5602
$ jobs
[3] + Running sleep 30&
[2] - Running sleep 60&
[1] Running sleep 120&
$ fg %2
sleep 60
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2002 02:13 PM
тАО11-27-2002 02:13 PM
Re: How to switch to a process in the background?
you should find out which job-number your process has. Then get the process into the fg and after you answered "y" you can put the process back into the background. Try this procedure:
1. jobs -> to get the job number (e.g. 1)
2. fg %1 -> process into fg
3. y -> your response to fbackup
4. bg %1 -> back to where it came from
I hope it helps
HV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2002 05:43 PM
тАО11-27-2002 05:43 PM
Re: How to switch to a process in the background?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2002 12:13 AM
тАО11-28-2002 12:13 AM
Re: How to switch to a process in the background?
- to launch in background, add a '&' at the end
- to put in foreground use fg command
$ jobs
get the number
$fg %number
- to put it in background if no '&'
You can't use bg ... You have to use control key defined for 'susp' in stty -a. I usually set it to CTRL-Z
$ stty -a
...
stop = ^S; start = ^Q; susp = ^Z; dsusp
...
If your susp is not set, you can still put it in background using a kill -SIGSTOP from another window.
When jobs indicates that a job is stopped, it's the only case when you can use 'bg' command to continue it in background
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2002 02:09 AM
тАО11-28-2002 02:09 AM
Re: How to switch to a process in the background?
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xa2decdec06f1d61190050090279cd0f9,00.html
ie: put
stty susp ^Z
in : ~/.profile
Later,
Bill