#
# Convert long windows filenames to their DOS 8.3 names
# (c)2002 thomas.kindler@gmx.de, released under the GPL.
#
# This script should be run on the output of "dir /x",
# and generates a batch file, that does the actual
# renaming.
#
# example:
#   dir /x *.mp3 | awk -f shortname.awk >temp.bat
#
# please download the awk intepreter from
# http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe
#

# only rename files where the shortname contains a "~"
#
$4 ~ /\~/ { 
            split($4, fn, ".")
            print "ren", $4, fn[1] ".XXX"
            print "ren", fn[1] ".XXX", fn[1] "." fn[2]
          }
