Gentoo Archives: gentoo-user

From: "Bo Ørsted Andresen" <bo.andresen@××××.dk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] {OT} dvdrip permissions error, alternative?
Date: Fri, 13 Oct 2006 08:27:32
Message-Id: 200610131023.23169.bo.andresen@zlin.dk
In Reply to: Re: [gentoo-user] {OT} dvdrip permissions error, alternative? by Grant
1 On Friday 13 October 2006 07:55, Grant wrote:
2 > #!/bin/bash
3 [SNIP]
4 > vobcopy -m || exit
5 > mkisofs -dvd-video -V $TITLE -o $FILENAME $TITLE || exit
6 [SNIP]
7 >
8 > Can you tell me what purpose the "|| exit" portions serve?
9
10 It's quite common is bash scripts to define a function named die:
11
12 die() {
13 echo "$@"
14 exit 1
15 }
16
17 If you define that at the top of your script you ceplace the above with this:
18
19 > vobcopy -m || die "vobcopy failed"
20 > mkisofs -dvd-video -V $TITLE -o $FILENAME $TITLE || die "mkisofs failed"
21
22 I hope you get the point...
23
24 --
25 Bo Andresen

Replies

Subject Author
Re: [gentoo-user] {OT} dvdrip permissions error, alternative? go moko <gomoko@×××××.com>