linux prompt break and start
colucix,
I have a doubt is it possible to execute a series of commands with prompt. Say Start Command1 Command2 stop (to verify) Start (should not restart from 1st command) Command3 stop (to verify) start (should not restart from 1st or 3rd command) Command4 end Please suggest, thanks in advance. |
You can simply stop the process by pressing Ctrl-Z, which is equal to send a TSTP signal (see man 7 signal for details). The process will be in a idle state until it receives a CONT signal. Since the process is sent in background upon interrupting, you can restore it by means of the fg command. Is this what you're looking for?
|
linux prompt break and start reply
Quote:
Sorry if i am confusing. Thanks |
If I understand well you want to give the ability to the user to interrupt a running process and proceed with the following statements in the script, is it correct?
In this case, if you want to use Ctrl-C to interrupt a single process, you have to use trap to execute a different action, otherwise the whole script will be interrupted. Then you launch the interruptible command in background and use wait to pause the script until the process has terminated OR until the user presses Ctrl-C to stop it. Example: Code:
#!/bin/bash |
All times are GMT -5. The time now is 10:16 PM. |