🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #17571

Re: trn, sh -c and interrupts-- bug or misfeature?

#17571
From: Ralph Jennings
Date: Wed, 15 Nov 1995 00:00
33 lines
2097 bytes
john hood (cgull@smoke.marlboro.vt.us) wrote:
: with /bin/sh on DEC OSF/1 v1.3 and 2.0 (i don't know about later
: versions), and every variant of the Almquist shell I've used on Linux,
: NetBSD and FreeBSD, a SIGINT from the keyboard will kill the shell, or
: at least cause it to to exit, while it's waiting for a child in 'sh -c
: command'.  every other shell i've tried, except for a fairly antique
: bash, ignores the signal.

: this causes considerable annoyance in trn, which uses sh -c to get
: Pnews started.  When you hit ^G in emacs or ^C in vi, you have a
: problem...sadly, there is no simple, general workaround/fix for trn.

: now, i'm not a shell wizard, and i can't find any documentation that
: says that this is legitimate or that it's not.  it's not a subtle
: problem; it's hard for me to believe nobody's noticed it. :)

: So, shell wizards:  bug or misfeature?  simple test script below.

Feature, you can use ^C to kill the program if you decide 
  that you don't want to wait for it finish doing what it's
  doing.  It's a feature for all of us impatient people.

Use trap like this, if you don't like that feature.

trap '' <interupts>

using trap with a : like you were makes the shell do nothing
  but all child processes get terminated.  Using it with a
  null tells even the child processes to ignore it.
-- 
F u cn rd ths u cnt spl wrth a dm!

Technical Details
Message-ID: <48dtgj$ftb@hg.oro.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.shell.mbox.zip!not-for-mail
References: <48c54t$qe3@sundog.tiac.net>

Show Full Headers
Complete Article Headers
Message-ID: <48dtgj$ftb@hg.oro.net>
Subject: Re: trn, sh -c and interrupts-- bug or misfeature?
Date: Wed, 15 Nov 1995 00:00:00 +0000
From: knowbudy@au.oro.net (Ralph Jennings)
References: <48c54t$qe3@sundog.tiac.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.shell.mbox.zip!not-for-mail
X-Deja-AN: 119439453
Followup-to: comp.unix.shell,news.software.readers
Organization: oronet -- Penn Valley, CA USA 916-477-6650
Newsgroups: comp.unix.shell,news.software.readers
Nntp-posting-user: knowbudy