rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Philippe Meunier <meunierp@anchor.cs.colorado.edu>
To: rc@hawkwind.utcs.toronto.edu
Subject: ^z
Date: Mon, 15 Nov 1993 18:59:58 -0500	[thread overview]
Message-ID: <199311152359.AA26576@duvel.cs.colorado.edu> (raw)

Hi everybody,

i have always used tcsh, but i am fed up with all the quoting problems,
so rigth now i am playing with rc to see how good it is. But i have
the following problem, which makes me a bit nervous about having rc
as my permanent shell (i have already looked at the archives about
this and fount some related mails, but nothing clearly explaining what
happens, so...) :

; stty susp '^z'
; sleep 5
^Z^Z^Z^Z;                  [why is it ignored ?]
; fn sigtstp {echo hello}
; sleep 5
^Zkilled                   [why is it killed ?]
hello
; fn sigtstp {}
; sleep 5
^Z^Z^Z^Z;                  [the behavior i was waiting]
; fn sigtstp
; sleep 5
[^z and shell dies]        [???]

According to signal(3), the default behavior for SIGTSTP it to stop
the process, so i really do not understand what is happening...

What i would like to do is something like the following :

fn sigtstp { proc_pid = `{ps ux|grep sleep|awk '{print $2}'}
             rc -i
             kill -19 $proc_pid
           }

ie, i would like to be able to temporarily stop a running process, to
do another task, and then restart the first process. Look at this as a
very basic kind of job-control (no flame, please).

BTW, i have two related questions:

- is there a nice way to set proc_pid to the pid of the process that
has received the SIGTSTP signal ? (i know the way i have done it in my
exemple is horrible and is not working, but it was just to give you an
idea of what i want to do...).

- what do you do when you forget to add an & at the end of the command
line ? Do you just kill the process and start a new one in the
background ?

If it matters, i have compiled rc with gcc 2.5.0 on a Sparc SLC,
running SunOS 4.1.4, with the following options (i give them all, just
in case):

#define CUSTOM
#define DEFAULTPATH "/usr/ucb", "/usr/bin", "/bin"
#define TMPDIR "/home/bigtime/meunierp/tmp"
#define DEFAULTINTERP "/bin/sh"
#define PROTECT_ENV

and that'all, no READLINE, no SVSIGS, so i think the problem is coming
from rc itself (in fact, i think there is no problem, just something
that i do not understand :-). I am starting rc by doing an "exec
./rc" from a tcsh, so it is not a login shell.

So would somebody be kind enough to explain me what's happening ? (and
remember, i have never used sh...).

Thanks in advance,

Philippe
_______________________________________________________________________
Philippe Meunier			meunierp@anchor.cs.colorado.edu


                 reply	other threads:[~1993-11-16  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199311152359.AA26576@duvel.cs.colorado.edu \
    --to=meunierp@anchor.cs.colorado.edu \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).