Onat I. wrote:
i wrote a simple cd encoder. while there is abcde
in ports, it is bloated and requires cdparanoia
which is unnecessary since cdio can now rip cds.
You still require lame, which is in ports.
I thought you might be interested.
Somewhat. But abcde finds the track names automatically.
And there are a few basic Unix shell issues with your script. At the
very least, combine the two tr steps into one.
ian:52$ echo '01 Foo Bar' | tr -d [:alpha:]|tr -d '[:punct:]
01
ian:53$ echo '01 Foo Bar' | tr -d '[:alpha:][:punct:]'
01
And, always quote special characters:
ian:19$ echo [:alpha:]
[:alpha:]
ian:20$ touch a
ian:21$ echo [:alpha:]
a
ian:22$ echo '[:alpha:]'
[:alpha:]
ian:23$
But, if your goal in the tr is just to get rid of non-digits, use tr -c:
ian:55$ echo '01 Foo Bar' | tr -cd '[:digit:]\n'
01
ian:56$