The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: Case Statement
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #12 (permalink)  
Old 04-01-2004
Zeta_Acosta Zeta_Acosta is offline
Registered User
 

Join Date: Mar 2004
Posts: 14
Unhappy

Ok I know that Im beginning to get on peoples nerves and I apologise for that! But can I ask one more question in relation to this script (please dont shout about it being a sh, Im sorry)

Why is this not working correctly now:

input: dosRename Mike *.mike

#!/bin/sh

for file
do
case $file in
*'*'*|?.)
if [ $file = *.[a-z] ]
then type=extension
elseif [$file = [a-z].*]
type=main
fi
echo $type
;;

*)
echo $file is a File
;;
esac
done

output:
$ dosRename Mike *.mike
Mike is a File
BLANKLINE:

Thank you all so much for the patience!
Reply With Quote