Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Dec 2001 23:32:14 -0500
From:      Matthew Graybosch <matthew@starbreaker.net>
To:        chkno@dork.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Using spaces within strings in /bin/sh scripts
Message-ID:  <200112032328.47191@starbreaker.net>
In-Reply-To: <200112040251.fB42psR38565@c1742628-a.vncvr1.wa.home.com>
References:  <200112040251.fB42psR38565@c1742628-a.vncvr1.wa.home.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 03 December 2001 21:51, you wrote:
> > I'm trying to write a script to rip an album to wave files,
> > encode each wave file using oggenc, and move them to a specified
> > directory.
> >
> > In this script I have several variables, like $ALBUM to store
> > the album title and $TRACK01 to store the title of the first
> > track. Right now I've been using %20 to substitute for spaces,
> > because oggenc freaks out when I feed it a -t ${TRACK01}
> > argument when $TRACK01 is a string with spaces in it.
> >
> > I read "man sh" and didn't find an escape code for a space, and
> > I'm not sure why I can't just use: export ALBUM="Ho Drakon Ho
> > Megas".
> >
> > I've attached a copy of the script, and would appreciate any
> > help.
>
> Quote your variables when you use them:
>
> cd "${RIPDIR}"
>
> oggenc -b 160 -t "${TRACK01}" -l "${ALBUM}" -a "${ARTIST}" -c
> "${GENRE}" -d "${YEAR}" "${RIPDIR}"/track01.wav
>
> mv "${RIPDIR}"*.ogg "${TARGDIR}"
>
> etc.
>
> (If this was your problem, you might want to forward this to the
> alias.  I can't, as I don't have a hostname at the moment
> (at&t/excite issues))

Ah yes, the negotiations between AT&T and Excite@Home. I read 
somewhat of the situation on Slashdot. No matter. I tried quoting 
the variables, and I just started encoding the last track on the 
disc. Thanks for the assist.

Now that I know how to go about it, I can start scripting the 
rip/encode process for all my CDs.

If anybody wants a script for a given album, let me know. If I have 
the album I'll belt out the script.
- -- 
Matthew Graybosch
http://www.starbreaker.net
GnuPG Key ID: 0x7D488659
"Sex, Unix, and rock 'n roll"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE8DFHOcCiK1X1IhlkRAsnLAKDQ/qJGiwG31/ry/A4RkVUrGxSTHwCfdGe7
8lis8o+SkEXlMNW9B+PzIiw=
=7tKg
-----END PGP SIGNATURE-----

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112032328.47191>