From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from duvel.cs.colorado.edu ([128.138.242.12]) by hawkwind.utcs.toronto.edu with SMTP id <35222>; Mon, 15 Nov 1993 19:00:12 -0500 Received: by duvel.cs.colorado.edu id AA26576 (5.65c/IDA-1.4.4 for rc@hawkwind.utcs.toronto.edu); Mon, 15 Nov 1993 16:59:58 -0700 Date: Mon, 15 Nov 1993 18:59:58 -0500 From: Philippe Meunier Message-Id: <199311152359.AA26576@duvel.cs.colorado.edu> To: rc@hawkwind.utcs.toronto.edu Subject: ^z 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