stacking case options


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting stacking case options
# 1  
Old 09-13-2006
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
# 2  
Old 09-13-2006
Yes, is is possible to nest case statements. You have a syntax error because you have missed the closing ";;" after the first "done".
# 3  
Old 09-14-2006
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)
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Stacking Columns

How do I stack several columns of data into their own rows? In: A,B,C,d,e,f,g,H,I 1,2,3,4,5,6,7,8,9 Out: A,B,C,X,Y,H,I 1,2,3,d,4,8,9 1,2,3,e,5,8,9 1,2,3,f,6,8,9 1,2,3,g,7,8,9 Mike (10 Replies)
Discussion started by: Michael Stora
10 Replies

2. Shell Programming and Scripting

Conversion from Upper Case to Lower Case Condition based

Hello Unix Gurus : It would be really appreciative if can find a solution for this . I have records in a file . I need to Capitalize the records based on condition . For Example i tried the following Command COMMAND --> fgrep "2000YUYU" /export/home/oracle/TST/data.dat | tr '' ''... (12 Replies)
Discussion started by: tsbiju
12 Replies

3. Shell Programming and Scripting

sed ignoring case for search but respecting case for subtitute

Hi I want to make string substitution ignoring case for search but respecting case for subtitute. Ex changing all occurences of "original" in a file to "substitute": original becomes substitute Origninal becomes Substitute ORIGINAL becomes SUBSTITUTE I know this a little special but it's not... (1 Reply)
Discussion started by: kmchen
1 Replies

4. Shell Programming and Scripting

data array needs to change upper case to lower case

Hi all, i have a data array as followes. ARRAY=DFSG345GGG ARRAY=234FDFG090 ARRAY=VDFVGBGHH so on.......... i need all english letters to be change to lower case. So i am expecting to see ARRAY=dfsg345ggg ARRAY=234fdfg090 ARRAY=vdfvgbghh so on........ If i have to copy this data in... (8 Replies)
Discussion started by: usustarr
8 Replies

5. Shell Programming and Scripting

use strings in case statement options

I iterate in string list well but when I try to add a case statement in order to wrap the string value in a more accurate message I faced different problems. #Code starts ST_CODES="CN CU BU CQ LE" for ST_CODE in $ST_CODES do #echo $ST_CODE CODE="$ST_CODE""\n" ... (3 Replies)
Discussion started by: fdiaza
3 Replies

6. Shell Programming and Scripting

Script needed to select and delete lower case and mixed case records

HELLO ALL, URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE. FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY and the CITY column records will be: Newyork washington ... (1 Reply)
Discussion started by: abhilash mn
1 Replies

7. UNIX for Dummies Questions & Answers

lower case to upper case string conversion in shell script

How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies
Login or Register to Ask a Question