Discussion: ctrl z question
Afficher un message
Vieux 05/06/2007, 03h01   #6
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ctrl z question

In article <1180931335.461414.61640@i38g2000prf.googlegroups. com>,
merrittr <merrittr@gmail.com> wrote:

> it is in a script, and the ctrl z is disabled by the command however I
> was hoping that when
> a ctrl-z was entered a message would be displayed. The previous poster
> had me thinking
> that job control plays a role
>
>
> #!/bin/bash
>
> trap "echo You\'re trying to Control-z me" SIGTSTP


It works for me with this script:

#!/bin/bash

trap "echo You\'re trying to Control-z me" SIGTSTP
while :; do
:
done

$ ./test.sh
<press C-z>
You're trying to Control-z me

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
 
Page generated in 0,05666 seconds with 9 queries