Hi,
I had the same problem a long time ago. My solution was to write a script which creates a script to do this.
The script you have sent is in some language I don't understand. So, I'm just guessing about the contents. My assumption is that you have a file (called dynamicinfo, say) with something like:
Arhivare Backpup Server Prosoft Computers (Mail, Website, Homesite)
Alive Verificare serverelor, clientilor online
Filtru Diverse filtre pentru traficul pe server
So, the script goes something like this: [newfile.sh is the new script that's being created]
Code:
#!/bin/ksh
touch newfile.sh
echo "#!/bin/ksh" >> newfile.sh
echo the first three lines of dialog command too. Use this:
Code:
cat >>newfile.sh <<EOF
dialog --clear --backtitle "<<<... PROSOFT COMPUTERS ...>>> Tel/fax: 40 246 231082"\
--title "MENIU PRINCIPAL" \
--menu "Pentru a va deplasa in sus, respectiv in jos - sageti \n\
[Enter] pentru selectare\n\
EOF
Now, comes the interesting part. You need to read from the file (the file with the dynamic info, dynamicinfo), a whole line and then split it into two parts, one containing the first word and one containing the rest. So, something like this should do:
Code:
while read line
do
echo "$line" | sed 's/\([^ ]*\) \(.*\)$/"\1" "\2"\\/' >>newfile.sh
done <dynamicinfo
echo '2> menuchoice.temp.$$' >>newfile.sh
Now, the newfile.sh script is ready. Call it with something like:
Code:
ksh newfile.sh
rm -f newfile.sh
I've skipped the parts of checking whether newfile.sh exists, and so on. Be careful!
I'd be glad to help out with anything you did not understand,
Arvind