[sclug] sclug Digest, Vol 67, Issue 10

Neil Haughton haughtonomous at googlemail.com
Wed Apr 22 19:51:40 UTC 2009


Thanks Bob and others for all your advice.  It's nearly there.

A couple of points: The filename is entirely arbitrary, because it is
essentially what is ripped from the track information on the CD. It could be


01.flac
Track4.flac
Obla Di Obla Dah.flac

etc

Hence my justification for wrapping each filename in quotes. However, the
line
shnjoin -o $1 *

will presumably give me a command line such as

shnjoin -o flac Obla Di Obla Dah.flac NextSong.flac NextSong After That.flac

I can seen this giving me problems, and I really don't want to have to
rename every file first if I can avoid it.

Is there a simple way of changing

shnjoin -o $1 *

to wrap the filenames in quotes, or at least have the effect of avoiding the
spaces causing parsing problems?eg:

shnjoin -o flac "Obla Di Obla Dah.flac" "NextSong.flac" "NextSong Too.flac"

Further comments embedded below:


> Here's my simpler version.
>
>
> #!/bin/bash
>
> if [ $# -ne 2 -o -z "$1" -o -z "$2" ]
> then
>        echo "Use: command codectype outputfilename"
>        exit 1
> fi
>
> echo "codec type=$1"
> echo "output file=$2"
>
> # Join all the files in the current directory together
> shnjoin -o $1 *
>
> #rename the result as asked
> mv joined.$1 $2.$1
>
>
>
>
> Then I don't like a script that joins everything in a directory into one
> file in the same directory.  Run it a second time and you'll end up in a
> right mess.
>

I'm not worried about this - it is only for my own use, and the script will
only be used straight after the tracks have been ripped into a new folder. I
take your point about the risk though.


>
> I'd suggest making the choice of input files a little more selective.
> Guessing that all input tracks are of the form ##.something I'd suggest.
>
> shnjoin -o $1 [0-9][0-9].*
>

Unfortunately the tracks could be [any character string including possibly
spaces].something, so I don't think this is going to be of use in this
instance.


> --
>        Bob Dunlop
>
>
> TIA

Neil.



More information about the Sclug mailing list