Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Dec 2001 21:28:14 -0500
From:      Matthew Graybosch <matthew@starbreaker.net>
To:        freebsd-questions@freebsd.org
Subject:   Using spaces within strings in /bin/sh scripts
Message-ID:  <200112032116.55282@starbreaker.net>

next in thread | raw e-mail | index | archive | help

--------------Boundary-00=_27SSW2B4947FAIHFF9UD
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.
- -- 
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

iD8DBQE8DDS+cCiK1X1IhlkRAjIuAKCu9DToHaci0mJUPsLqXFKrbdFPVACeIbsG
zbVrJbKJrrpn2TcFT69gOiM=
=rsH4
-----END PGP SIGNATURE-----

--------------Boundary-00=_27SSW2B4947FAIHFF9UD
Content-Type: application/x-shellscript;
  name="therion.HoDrakon.sh"
Content-Transfer-Encoding: base64
Content-Description: script to rip Therion's "Ho Drakon Ho Megas"
Content-Disposition: attachment; filename="therion.HoDrakon.sh"

IyEvYmluL3NoCgpleHBvcnQgQVJUSVNUPSJUaGVyaW9uIgpleHBvcnQgQUxCVU09IkhvJTIwRHJh
a29uJTIwSG8lMjBNZWdhcyIKZXhwb3J0IFlFQVI9IjE5OTkiCmV4cG9ydCBHRU5SRT0iQmxhY2sl
MjBNZXRhbCIKZXhwb3J0IFJJUERJUj0iL2hvbWUvbWF0dGhldy9mcnlwYW4iCmV4cG9ydCBUQVJH
RElSPSIvaG9tZS9tYXR0aGV3L211c2ljL1RoZXJpb24uSG9EcmFrb25Ib01lZ2FzIgoKZXhwb3J0
IFRSQUNLMDE9IkJhYWwlMjBSZWdpbm9uIgpleHBvcnQgVFJBQ0swMj0iRGFyayUyMFByaW5jZXNz
JTIwTmFhbWFoIgpleHBvcnQgVFJBQ0swMz0iQSUyMEJsYWNrJTIwUm9zZSIKZXhwb3J0IFRSQUNL
MDQ9IlN5bXBob25pJTIwRHJha29uaXMlMjBJbmZlcm5pIgpleHBvcnQgVFJBQ0swNT0iRGF3biUy
MG9mJTIwUGVyaXNobmVzcyIKZXhwb3J0IFRSQUNLMDY9IkV5ZSUyMG9mJTIwRWNsaXBzZSIKZXhw
b3J0IFRSQUNLMDc9IlJpdHVhbGRhbmNlJTIwb2YlMjB0aGUlMjBZZXppZGlzIgpleHBvcnQgVFJB
Q0swOD0iUG93ZXJkYW5jZSIKZXhwb3J0IFRSQUNLMDk9IlByb2NyZWF0aW9uJTIwb2YlMjBFdGVy
bml0eSIKZXhwb3J0IFRSQUNLMTA9IkhvJTIwRHJha29uJTIwSG8lMjBNZWdhcyIKCmNkICR7UklQ
RElSfQoKZGFncmFiIC1hIC1kIC9kZXYvYWNkMGMKCm9nZ2VuYyAtYiAxNjAgLXQgJHtUUkFDSzAx
fSAtbCAke0FMQlVNfSAtYSAke0FSVElTVH0gLWMgJHtHRU5SRX0gLWQgJHtZRUFSfSAke1JJUERJ
Un0vdHJhY2swMS53YXYKCm12ICR7UklQRElSfSoub2dnICR7VEFSR0RJUn0=

--------------Boundary-00=_27SSW2B4947FAIHFF9UD--

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?200112032116.55282>