Monday, December 8, 2008

[Unix] File management

Yes, I know - it's neither Baking nor DBA. But still relevant.

I had a set of files named .Z.aa that I needed to decompress. GUNZIP doesn't like those extensions, so it ignores it. Here's a basic hack using Cygwin. (You are using Cygwin, right?)

for i in *.Z.aa;
do
j=`basename $i .aa`;
echo
mv $i $j;
mv $i $j;
echo
gunzip $j;
gunzip $j;
done

No comments: