The UNIX and Linux Forums  

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


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script needed to select and delete lower case and mixed case records abhilash mn Shell Programming and Scripting 1 03-17-2008 05:00 AM
To CASE or not to CASE, this is my question! olimiles Shell Programming and Scripting 1 08-19-2006 01:54 AM
Ignore case sensitive in Case Switch annelisa Shell Programming and Scripting 1 07-13-2006 01:36 AM
options terms5 UNIX for Dummies Questions & Answers 1 01-26-2006 10:50 PM
lower case to upper case string conversion in shell script dchalavadi UNIX for Dummies Questions & Answers 3 05-28-2002 09:07 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-13-2006
Registered User
 

Join Date: Sep 2006
Posts: 23
stacking case options

possible to stack case commands ? I get an error, s. comments below

select choice in search delete quit
do

case $choice in
search)

select option in title director year
do

case $option in
title)
.....
break
;;

director)
.....
break
;;

year)
......
break
;;

quit)
exit
;;

esac
done

# program works up to here

# if I choose any of the options below I get an error message "syntax error near unexpected token ')'
'delete)'


delete)
.....
break
;;

quit)
exit
;;

esac
done
Reply With Quote
Forum Sponsor
  #2  
Old 09-13-2006
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Yes, is is possible to nest case statements. You have a syntax error because you have missed the closing ";;" after the first "done".
Reply With Quote
  #3  
Old 09-13-2006
Registered User
 

Join Date: Sep 2006
Posts: 23
you mean

quit)
exit
;;

esac
done
;; # here ?!?
# program works up to here

# if I choose any of the options below I get an error message "syntax error near unexpected token ')'
'delete)'


delete)
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0