Andrew writes:
>> Do you need the /tmp/dlgmenu file at all?
> Yes. The menu is built dynamically. /tmp/dlgmenu could contain:
> hda "Auto-partition drive /dev/hda" sda "Auto-partition drive /dev/sda"
> ...
Okay, but if you generate the file just to read it out later in the
same script, a variable might do also. If not, you could do it like
this: get the number of lines in the file, read each line, and add it
to an array of arguments:
menufile=/tmp/dlgmenu
n=$(( `cat $menufile | wc -l` ))
for (( i=0; i < n; i++ ))
do
line[$(( $i ))]=`cat $menufile | head -$(( $i+1 )) | tail -1`
done
dialog --menu "Choose a partition..." 12 60 8 "[EMAIL PROTECTED]" 2> > /tmp/menuoption
There might be more elegant way, though.
Alex
--
Alex Schuster [EMAIL PROTECTED] PGP Key available
[EMAIL PROTECTED]
--
[EMAIL PROTECTED] mailing list