| View previous topic :: View next topic |
| Author |
Message |
schachti Advocate


Joined: 28 Jul 2003 Posts: 3765 Location: Gifhorn, Germany
|
Posted: Mon Feb 01, 2010 1:15 pm Post subject: [Solved] Bash Skript und CTRL-C |
|
|
Wahrscheinlich ist die Lösung ganz einfach, aber ich komme nicht drauf: Ein Bash-Skript führt nacheinander mehrere Befehle aus. Ich möchte nun, dass das Drücken von CTRL-C nur den aktuellen Befehl abbricht, nicht die Abarbeitung des Skripts (so dass das Skript mit dem nächsten Befehl weitermacht). Hat jemand eine Idee, wie das geht?
EDIT: Solved. _________________ Never argue with an idiot. He brings you down to his level, then beats you with experience.
How-To: Daten verschlüsselt auf DVD speichern.
Last edited by schachti on Mon Feb 01, 2010 2:07 pm; edited 1 time in total |
|
| Back to top |
|
 |
papahuhn Guru


Joined: 06 Sep 2004 Posts: 418
|
Posted: Mon Feb 01, 2010 1:50 pm Post subject: |
|
|
| Code: | #!/bin/bash
trap " " INT
perl -e 'print "eins\n"; 1 while 1'
perl -e 'print "zwei\n"; 1 while 1'
perl -e 'print "drei\n"; 1 while 1' |
_________________ Death by snoo-snoo! |
|
| Back to top |
|
 |
schachti Advocate


Joined: 28 Jul 2003 Posts: 3765 Location: Gifhorn, Germany
|
Posted: Mon Feb 01, 2010 2:08 pm Post subject: |
|
|
Danke, klappt wunderbar! _________________ Never argue with an idiot. He brings you down to his level, then beats you with experience.
How-To: Daten verschlüsselt auf DVD speichern. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|