par2unpack and the problem with copying code from my blog

Saturday, 17 February 2007

I’ve just discovered that using copy/past to grab a copy of the par2unpack.sh script I posted will render the script NON-EXECUTABLE!

Very annoying indeed. I suspect it’s probably a problem with the character encoding used by wordpress, which prevents correct interpretation by the shell. The fix is quite clumsy, as usual, but should work; I have converted the script to pdf.
All you need to do is open it and then use copy/paste to copy the code into your text editor. Then save it under whatever filename you like (although I personally think par2unpack is a logical choice). The reason for this mess? Well, it seems wordpress will not allow me to upload text files, so I fear there is simply nothing else for it :-(

Maybe soon I will start making the script a bit more userfriendly, add recursive unpacking, etc. If I have time for it.
In the mean time, this is an example of how you use it:
$:> par2unpack.sh /my/dir/with/lots/of/different/files/to/unpack

Have fun!

Here is the pdf:
par2unpack.pdf

[EDIT]
I have fixed a dumb mistake in the script, which prevented it from correctly moving into directories with spaces in their names, such as “/home/myname/usenet/return\ of\ the\ incredible\ spidermonkeys/” for example. I hope there are no more stupid mistakes like that, but for now it seems to work as intended.
I have also taken the liberty of omitting the extension “.sh” from the name. I’m probably being very naughty, but I don’t care: it looks better that way ;)
[/EDIT]