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 -->
  #1 (permalink)  
Old 03-31-2004
Zeta_Acosta Zeta_Acosta is offline
Registered User
 

Join Date: Mar 2004
Posts: 14
Case Statement

Can anyone please tell me why this wont work! Thanks so much!

#!/bin/sh

for file
do
case $file in
*.*.*)
echo Cannot have more than 1 dot
exit
;;

*'**'*)
echo Cannot have more than 1 asterisk
exit
;;

*'*'*|?.)
echo this is a target

;;

*)
echo This is a file
item = file
;;
esac
done

if [! -e "$item"];
echo The File does not exit
exit
fi

It just says Item not found? Thanks
Reply With Quote
Forum Sponsor