Programming and Scripting :: Dialog helper



Thanks to WDef now my script works almoost pefectly.
I have now one problem. Sometimes I need to show ASCII graphics in dialog or any text that has multiple spaces in a row. It seems that dialog (I don't know about whiptail) removes any extra spaces. Any Idea how to left these spaces there?

EDIT: A-ha! --no-collapse switch will do the thing. ;)

http://zelan.zapto.org:8888/dialog.png
I'll have to test with whiptail also to make this work in DSL also. ;)

You can make your script read argument text by calling your msgboxDialog function so:

Code Sample
msgboxDialog "$( echo -e "${1}" )"




Then try (eg):

Code Sample
./zuccacript.sh "1 2 3 \n 4 \n 5 \n 6 \n blah blah"



EDIT: Note this preserves whitespace in the argument string without  --no-collapse option to dialog/whiptail, which isn't recognized by dsl's version anyway.

Do you guys have any suggestions where should this hmmm... script library (?) to be located in system.
Somewhere in /usr/share?

/usr/share/doc?
It's rather a shared library.
You can 'include' it in a bash script with source command.

Next Page...
original here.