rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* ^z
@ 1993-11-15 23:59 Philippe Meunier
  0 siblings, 0 replies; only message in thread
From: Philippe Meunier @ 1993-11-15 23:59 UTC (permalink / raw)
  To: rc

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1993-11-16  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-11-15 23:59 ^z Philippe Meunier

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).