From owner-freebsd-questions Mon Dec 3 20:24:25 2001 Delivered-To: freebsd-questions@freebsd.org Received: from IMGate1.cshore.com (imgate1.cshore.com [63.237.136.14]) by hub.freebsd.org (Postfix) with ESMTP id 9233537B416 for ; Mon, 3 Dec 2001 20:24:21 -0800 (PST) Received: from there (dialup-uu-dynamic160.cshore.com [63.112.158.160]) by IMGate1.cshore.com (Postfix) with SMTP id 516EF23ECE; Mon, 3 Dec 2001 23:24:55 -0500 (EST) Content-Type: text/plain; charset="iso-8859-1" From: Matthew Graybosch Reply-To: matthew@starbreaker.net Organization: starbreaker.net Message-Id: <200112032328.47191@starbreaker.net> To: chkno@dork.com Subject: Re: Using spaces within strings in /bin/sh scripts Date: Mon, 3 Dec 2001 23:32:14 -0500 X-Mailer: KMail [version 1.3] References: <200112040251.fB42psR38565@c1742628-a.vncvr1.wa.home.com> In-Reply-To: <200112040251.fB42psR38565@c1742628-a.vncvr1.wa.home.com> Cc: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG -----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