Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Bash Skript und CTRL-C
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Mon Feb 01, 2010 1:15 pm    Post subject: [Solved] Bash Skript und CTRL-C Reply with quote

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
View user's profile Send private message
papahuhn
Guru
Guru


Joined: 06 Sep 2004
Posts: 418

PostPosted: Mon Feb 01, 2010 1:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Mon Feb 01, 2010 2:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
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