- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Moving a Foreground Process to 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
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
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
тАО05-14-2002 09:13 AM
тАО05-14-2002 09:13 AM
In addition to running a process in the background using &, you can move a foreground process into the background. My script book says that in order to do so, you press the Ctrl+Z key and see the following (the ^Z is your Ctrl+Z key being echoed).
^Z[1] + Stopped (SIGTSTP)
PROBLEM: Pressing CTRL+Z Doesn't work for me!
I was wondering if it depends on the shell.
Lemme know!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2002 09:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2002 09:25 AM
тАО05-14-2002 09:25 AM
Re: Moving a Foreground Process to the Background
I believe it depends on your stty settings (do a man on stty). I have yet to figure out what needs to be set - if I do, I'll let you know. And, yes, it is dependant on the shell.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2002 09:32 AM
тАО05-14-2002 09:32 AM
Re: Moving a Foreground Process to the Background
do a stty | grep Z to know what is it set to . or may be try changing the shell .
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2002 09:38 AM
тАО05-14-2002 09:38 AM
Re: Moving a Foreground Process to the Background
stty -a to see what your current settings are
To set to another parameter just
stty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2002 09:43 AM
тАО05-14-2002 09:43 AM
Re: Moving a Foreground Process to the Background
On my system, stty shows:
stty
speed 9600 baud; evenp hupcl
intr = ^C; erase = ^H; kill = ^U;
eol2 = ^@; swtch = ^@;
susp = ^Z; dsusp = ^Y;
werase = ^@; lnext = ^V;
-inpck -istrip icrnl -ixany ixoff onlcr
-iexten echo echoe echok
-echoctl -echoke
This leads me to believe that we're after the suspend character. However, the following test:
$ xclock -digital -update 1
(I pressed ctrl-Z here)
[1] + Stopped xclock -digital -update 1
$
stops (or suspends) the clock. I would expect to be able to do a ctrl-Y to get it back but that doesn't work. I had to use Shiju's suggestion to bring it back to the foreground - where it resumed running.
Not much help, I'm afraid.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2002 10:49 PM
тАО05-14-2002 10:49 PM
Re: Moving a Foreground Process to the Background
your shell has to be set up correctly to be able to suspend a running job. As the others mentioned check your stty settings. Of course you could set another Key than Ctrl-Z but this is not reconmendet. This can be done in your .profile.
After suspending a job you have to put it in background (bg) to keep it running. A suspended job is holded.
You can have several jobs running in background, which you can check with jobs.
To put one of these jobs in foreground just use fg %n where n is the number of the backgroundjob as shown with jobs.
Hope this helps
Regards Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2002 10:26 AM
тАО05-15-2002 10:26 AM
Re: Moving a Foreground Process to the Background
> stty -a
to list the setup. I found that susp was undef. So I then typed
> stty susp ^Z
Now stty -a shows the susp defined as a control Z (^Z).
I then started a long find command.
I was then able to hit ctrl z and it suspended the job. With bg %1 I was able to put it in the background and with fg %1 brought it back.
You should look at your .profile and see if stty sets are made and if not you may want to add susp ^Z to set suspend.