2 # dosfndecode - dos filename decoder
3 # (c) 2000 by plasmoid / thc <plasmoid@pimmel.com>
5 # convert files cutted to the dos extension (8.3 format) into proper unix
6 # files by evaluating the ident definition. the ident definition can be
7 # found in correct formated source trees, as for e.g. *surprise* *surprise*
10 # this tool comes really handy if you have the broken solaris 2.7 source
11 # that is flying around. but don't ask us, we don't have warez. sorry!
16 if [ "x$1" = "x" -o ! -d $1 ] ; then
17 echo "dos filename decoder - (C) 2000 by plasmoid / thc <plasmoid@pimmel.com>"
19 echo " where dir is the directory to convert recursively"
23 for j in `find $1 -type d` ; do
27 identline=`egrep -se \("#ident"\|"#pragma ident"\) $i`
29 if [ "x$identline" != "x" -a "x`echo $0 | grep $i`" = "x" ] ; then
30 newname=`echo $identline | sed s/@\(\#\)/!/g | cut -d! -f2`
31 newname=`echo $newname | awk '{ print $1 }'`
32 if [ "x`echo $newname | grep :`" != "x" ] ; then
33 newname=`echo $newname | cut -d: -f2`
35 if [ $i != $newname ] ; then
36 echo " -- converting $i -> $newname"