Welcome, Guest. Please login or register.

Author Topic: Is there a convention for Break signals other than C?  (Read 6517 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kolla

Re: Is there a convention for Break signals other than C?
« on: February 16, 2021, 07:47:31 PM »
https://wiki.amigaos.net/wiki/Exec_Signals

Quote

SIGBREAKB_CTRL_C
The SIGBREAKB_CTRL_C signal bit is used extensively as the general purpose "Break" signal. It is used by all shell handler commands and many applications to invoke a normal exit of the program. It is up to all applications to follow this recommendation.
Applications should never crash or generally misbehave when receiving a SIGBREAKB_CTRL_C signal bit from any source.

SIGBREAKB_CTRL_D
The SIGBREAKB_CTRL_D signal bit is used mostly by the shell handler to stop execution of a script file or non-interactive stream. It may also be used by applications.
Applications should never crash or generally misbehave when receiving a SIGBREAKB_CTRL_D signal bit from any source.

SIGBREAKB_CTRL_E
The SIGBREAKB_CTRL_E signal bit is not currently used by the shell handler but may be used by some other handlers, OS subsystems or multi-process applications for general undefined inter process signalling.
Applications should never crash or generally misbehave when receiving a SIGBREAKB_CTRL_E signal bit from any source.

SIGBREAKB_CTRL_F
The SIGBREAKB_CTRL_E signal bit is not currently used by the shell handler but may be used by some other handlers, OS subsystems or multi-process applications for general undefined inter process signalling.
Applications should never crash or generally misbehave when receiving a SIGBREAKB_CTRL_F signal bit from any source.

There, now you can yell at me again :)
« Last Edit: February 16, 2021, 07:48:06 PM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: Is there a convention for Break signals other than C?
« Reply #1 on: February 18, 2021, 12:28:54 PM »
When you run a script, and want to break it, you typically end up sending ctrl-d + ctrl-c

- ctrl-d tells the shell to break the script and stop running more commands, but the currently running program stays running.
- ctrl-c tells the running program to break and exit.

If you, say, swap it around, and send ctrl-c before ctrl-d, you will break the currently running program, but the script may then just jump on to the next command and your ctrl-d wil just "hang around" till that program is done.
« Last Edit: February 18, 2021, 12:29:56 PM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: Is there a convention for Break signals other than C?
« Reply #2 on: February 18, 2021, 01:01:08 PM »
I think everybody here already knows that.
Good, but sometimes ctrl+c is enough to break the shell script too, and sometimes ctrl+c will _never_ break the shell script.
Does everybody here know the reasons for these cases as well?
« Last Edit: February 18, 2021, 01:01:41 PM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: Is there a convention for Break signals other than C?
« Reply #3 on: February 19, 2021, 11:37:24 AM »
I would assume because the program responding to Ctrl-C exits with a return code greater than the failat value so the script terminates.

Correct - except that this doesn't always work.

The shell of OS 3.1.4 has a bug, so FailAt levels are ignored, and scripts will continue regardless, so... make sure to install OS 3.1.4.1 update,  run SetPatch and make sure shell is 46.21 (or newer) before you do anything fancy.

@ NinjaCyborg
Look! I did it again! Another dig at ThoR! :D
« Last Edit: February 19, 2021, 11:41:15 AM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: Is there a convention for Break signals other than C?
« Reply #4 on: February 20, 2021, 05:16:13 AM »
I think everybody here already knows that.

Looks like buddy Tygre doesn’t understand the difference between ctrl+c and ctrl+d when it comes to script execution - maybe you can explain to him.

https://forum.amiga.org/index.php?topic=75064.msg851630#msg851630
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: Is there a convention for Break signals other than C?
« Reply #5 on: February 21, 2021, 04:11:11 PM »
Mind your language, avoid personal attacks and stay on topic - ctrl+f is not equivalent sending “quit” (as suggested in that other thread.)
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS