Re: Non-printable Bytes in Variable Data
On Wed, Dec 06, 2006 at 12:05:52PM -0600, Martin McCormick wrote:
> I am working on a shell script that generates file names
> to use with bladeenc. Everything works right except that every
> single music file the script creates via bladeenc has a ? or
> question mark preceding the words of the title. Example: A
> Christmas disk contains a song named "Joy to the World" which
> comes out as a file named "?Joy to the World.mp3". I don't think
> there is anything wrong with bladeenc because I can manually
> produce "Joy to the World.mp3" with spaces and all by enclosing
> the name of the output file in "" or double quotations. This
> means my script is sneaking nulls or who knows what else in to
> the variable which I called $songfilename.
> Isn't there something I can do in sed along the lines of
> sed '/[[0-9][a-z][A-Z ]]/p'
> to pass only blanks, letters and numbers, but filter out anything
How does your script create the file names?
> The example above is not quite what I need. It just
> passes everything so what I want is to pass only what matches the
> regular expression.
> I did make the shell script print the title with an
> echo $songfilename
> and what it printed looked perfect.
echo "$songfilename" | od -to1z
The more things change, the more they'll never be the same again.