
pbasename

Strips paths and given prefix from names.
I tried to make it work like GNU basename 1.12.
Man page is included.
It's just a modified version of the basename 1.12 man page.


I used this util to make it easier to copy lots of C64 music files names
"PSID.name.gz" to M$-Dozeized filesystem, and to rename PSID.* files to
psid.*, and stuff like that. Example:

#bash> for a in $(find . -name "PSID.*") ;\
        do mv $a $(dirname $a)/psid.$(pbasename $a PSID.) ;\
       done

This would result in

mv ./Anthony_Crowther/PSID.Black_Thunder.gz ./Anthony_Crowther/psid.Black_Thunder.gz
mv ./Anthony_Crowther/PSID.Deathringer.gz ./Anthony_Crowther/psid.Deathringer.gz
mv ./Anthony_Crowther/PSID.Ratt_Music.gz ./Anthony_Crowther/psid.Ratt_Music.gz

And so on. Of course, same result would be easy to do with awk/sed/whatever,
but having another shell util is always nice.


veijalai@cc.lut.fi

