[linux-l] trap-Kommandoausführung

Axel Weiß aweiss at informatik.hu-berlin.de
Mo Jun 7 21:20:39 CEST 2004


Lutz Meinert wrote:
> Hallo,
>
> Habe eine kleine Irritation bezüglich trap!
>
> Gebe ich auf der Konsole folgendes ein:
>
> $ trap "" 2 3
> p10: lutz  /data/DataL/Config
> $ trap
> trap -- '' SIGINT
> trap -- '' SIGQUIT
>
> und möchte anschließend beispielsweise ein "find / *bla" mit <Strg>+C
> abbrechen, funktioniert trap prima, indem er jenes - wie zuvor definiert
> - verhindert.
>
>
> Gebe ich nun aber folgendes ein:
>
> $ trap 'touch ~/bla' 2 3
> p10: lutz  /data/DataL/Config
> $ trap
> trap -- 'touch ~/bla' SIGINT
> trap -- 'touch ~/bla' SIGQUIT
>

Ich habe gerade folgendes probiert:

axel at rantanplan:~/test> trap 'touch trapped' 2 3
axel at rantanplan:~/test> trap
trap -- 'touch trapped' SIGINT
trap -- 'touch trapped' SIGQUIT
axel at rantanplan:~/test> find / <irgendwas> # mit CTRL-C abgebrochen
axel at rantanplan:~/test> ls
trapped
axel at rantanplan:~/test> rm trapped
axel at rantanplan:~/test> trap 'touch ./trapped' 2 3
axel at rantanplan:~/test> trap
trap -- 'touch ./trapped' SIGINT
trap -- 'touch ./trapped' SIGQUIT
axel at rantanplan:~/test> find / <irgendwas> # mit CTRL-C abgebrochen
axel at rantanplan:~/test> ls

Bin auch ratlos.

Gruß,
			Axel

-- 
Humboldt-Universität zu Berlin
Institut für Informatik
Signalverarbeitung und Mustererkennung
Dipl.-Inf. Axel Weiß
Rudower Chaussee 25
12489 Berlin-Adlershof
+49-30-2093-3050
** www.freesp.de **



Mehr Informationen über die Mailingliste linux-l