> I'm tweaking that script you wrote.  Here's what I have:
>
> #!/bin/bash
>
> echo Enter DVD filename:
> read FILENAME
> mount /dev/cdrom
> TITLE=$(vobcopy -I 2>&1 | awk '/DVD-name:/ {print $3}')
> vobcopy -m || exit
> mkisofs -dvd-video -V $TITLE -o $FILENAME $TITLE || exit
> rm -rf $TITLE
> umount /dev/cdrom
>
> Can you tell me what purpose the "|| exit" portions serve?

'||' is a logical or. When used to chain commands, as in "cmd1 || cmd2"
it means run cmd1, if that fails run cmd2 (if the first command succeeds
and returns true, the OR will alsays be true so there's no need to run
cmd2). All is does here is exit the script if vobcopy or mkisofs return
an error, because there'd be no point in continuing.

Got it.

> Also, how
> can I run the script by typing /path/to/getdvd?  I've tried:
>
> chmod +x getdvd

That should work, assuming you're i the same directory at getdvd. I keep
my scripts in ~/bin, with the x bits set, and have ~/bin in $PATH, so I
don't need to give the path to run them.

Here's what I get:

[EMAIL PROTECTED] ~ $ ls -l
-rwxrwxrwx 1 grant grant  386 Oct 12 22:24 getdvd
[EMAIL PROTECTED] ~ $ getdvd
-bash: getdvd: command not found

I like the sound of your ~/bin setup.  How can I add that to my PATH
permanently?  Is it 'export PATH=~/bin' ?

- Grant
--
[email protected] mailing list

Reply via email to