I copied the below program to play around with displaying a list of items using the select command in ksh. When I put all items in the same line, it works fine. I am trying to use multiple lines instead of a single row...my list is too large for a single line. How do I get the line continuation to work properly. The initial script used a "\" at the end of the 2nd, 3rd, and 4th lines in the "select" command...this only displayed the "\" before the ^J. I took the "\" out, but that didn't change the output format. Here's the code:
#!/bin/ksh
set -A termnames gl35a t2000 s531 vt99
echo "\n"
print 'Select your terminal type:'
echo "\n"
PS3='terminal? '
select term in '
'Givalt GL35a'
'Tsoris T-2000'
'Shande 531'
'Vey VT99''
do
if [[ -n $term ]]; then
TERM=${termnames[REPLY-1]}
print "TERM is $TERM"
break
fi
done
***********************************
The output below is from the above "select" command:
Select your terminal type:
1) ^J Givalt
2) GL35a^J Tsoris
3) T-2000^J Shande
4) 531^J Vey
5) VT99
terminal? 1
TERM is gl35a
I have also tried removing the single quotes that surround the list in the select command, but this returns the syntax error:
termname.sh[8]: syntax error at line 9 : `newline or ;' unexpected
Any help would be greatly appreciated.
Thanks,
Jeff