#!/bin/sh
#
# rni files ...
#
# Rename image files
#
#
# Boyd Roberts <[email protected]>
# April 2000
#
myname="`basename \"$0\"`"
view='xv'
case $# in
0)
echo "usage: $myname files ..." 1>&2
exit 1
;;
esac
for i
do
# get extension
x="`expr \"$i\" : '.*\.\(.*\)'`"
# view image
if $view "$i"
then
echo -n "New name for '$i'? "
if read n
then
case "$n" in
'')
# no
continue
;;
*.*)
# new name with extension
;;
*)
# tack on extension
n="$n.$x"
;;
esac
mv "$i" "$n"
else
exit 0
fi
fi
done
|