Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How To Spice Up Menus in Bash

1 view
Skip to first unread message

googl...@hotpop.com

unread,
Jun 4, 2005, 5:42:25 PM6/4/05
to
Anyone out there use Suse's Yast tool from command line? I want to
create some simple command line tools for adding users into a database,
but want to spice it up a little like Yast. Moreover, I want to keep
this really, really simple by using Bash. Is there a program I can
download that lets me create scripts in Bash to give me a Yast-like
experience? Also, you Novell-heads out there (said nicely -- I once was
a CNE) you may remember the Novell command line text GUI (TUI)
environment that is similar to Yast.

Anyone got an answer? Much appreciated. Thanks.

Michael Heiming

unread,
Jun 4, 2005, 5:46:17 PM6/4/05
to
In comp.unix.shell googl...@hotpop.com:

> Anyone out there use Suse's Yast tool from command line? I want to
> create some simple command line tools for adding users into a database,
> but want to spice it up a little like Yast. Moreover, I want to keep
> this really, really simple by using Bash. Is there a program I can

man dialog

Good luck

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvp...@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 108: The air conditioning water supply pipe
ruptured over the machine room

Chris F.A. Johnson

unread,
Jun 4, 2005, 6:08:10 PM6/4/05
to

I have no idea what Yast looks like, but you can do almost anything
with a shell script (including mouse control).

If you tell us what you want, no doubt someone here will be able to
help. You might find useful information in the Linux console_codes
man page. There's also a chapter in my book (see URL in my sig) on
screen manipulation.

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
==================================================================
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
<http://www.torfree.net/~chris/books/cfaj/ssr.html>

Chris F.A. Johnson

unread,
Jun 4, 2005, 6:12:36 PM6/4/05
to
On 2005-06-04, Michael Heiming wrote:
> In comp.unix.shell googl...@hotpop.com:
>> Anyone out there use Suse's Yast tool from command line? I want to
>> create some simple command line tools for adding users into a database,
>> but want to spice it up a little like Yast. Moreover, I want to keep
>> this really, really simple by using Bash. Is there a program I can
>
> man dialog

Horrible to look at, horrible to script with, and utterly
inflexible. Once can do a lot more with a few shell functions.

Michael Heiming

unread,
Jun 5, 2005, 2:45:45 AM6/5/05
to
In comp.unix.shell Chris F.A. Johnson <cfajo...@gmail.com>:

> On 2005-06-04, Michael Heiming wrote:
>> In comp.unix.shell googl...@hotpop.com:
>>> Anyone out there use Suse's Yast tool from command line? I want to
>>> create some simple command line tools for adding users into a database,
>>> but want to spice it up a little like Yast. Moreover, I want to keep
>>> this really, really simple by using Bash. Is there a program I can
>>
>> man dialog

> Horrible to look at, horrible to script with, and utterly
> inflexible. Once can do a lot more with a few shell functions.

Perhaps, for the few cases I have used 'dialog' it worked like a
charm and was easy enough to get it up/running in a minute.

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvp...@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'

#bofh excuse 16: somebody was calculating pi on the server

comp.unix.shell

unread,
Jun 5, 2005, 3:02:25 AM6/5/05
to
Dialog is good to use it. You can see all examples in dialog directory
(/usr) or see online at
http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/ch04sec11.html

and
http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/scripts/q18

Hope this helps

Alan Connor

unread,
Jun 5, 2005, 4:04:26 AM6/5/05
to
On comp.unix.shell, in
<1117954945.9...@o13g2000cwo.googlegroups.com>,
"comp.unix.shell" wrote:

> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/ch04sec11.html

Sure does. Thanks. I've been playing with the scripts
in ..../examples since Michael's post and think it
is a pretty cool little utility.

(but not for someone who doesn't have a handle on bash)

I also recognize it from the Debian installation
process.

Hope one of those sites tells how to change the colors
of the box and background, etc. There's nothing in the
man page about it.

AC

Chris F.A. Johnson

unread,
Jun 6, 2005, 1:30:08 AM6/6/05
to

Not good; see <http://torfree.net/~chris/dialog.html> (beware, the
images are quite large).

The problems with dialog include:

It uses the entire screen for one dialog box
It assumes that the font has line-drawing characters
The background colour cannot be changed

With a few shell functions, a much more flexible system can be put
together. The following script uses a stripped down set of
functions from my library. It doesn't have all the functionality
of the q18 script, but it shows that it is possible.

The script requires ANSI terminal emulation (xterm/rxvt, linux,
vt100, etc...) and a POSIX shell.


######### menu-demo ###########
cd

## Download cfajfuncs (if necessary)
type cfajfuncs || [ -f ./cfajfuncs ] || {
printf "%s\n" "Downloading cfajfuncs"
wget http://torfree.net/~chris/cfajfuncs ||
exit 5
}

. cfajfuncs ## <http://cfaj.freeshell.org/src/scripts/cfajfuncs>

menu='
Select one of the following
===========================
1. Calendar
2. Date and time
3. Exit
===========================
'

clear
IFS=$NL
printat 1 1
cursor 0
oy=4
ox=2
while :
do
get_size
blockinfo $menu
mx=$(( ($COLUMNS - $line_max) / 2 ))
my=$(( ($LINES - $block_items - 2) / 2 ))
shadow_block $my $mx $yellow $blue $menu
get_key
clear_block $oy $ox $block
case $_KEY in
1) block=$(cal)
shadow_block $oy $ox $black $yellow $block
;;
2) block=$(date "+ Year: %Y%nMonth: %b%n Day: %d%n Time: %H:%M:%S")
bold
shadow_block $oy $ox $yellow $red $block
bold 0
;;
3|q|x) clear_block $my $mx $menu
break
;;
esac
done

printat 1 1 "${ESC}[0m"
stty sane
cursor 1

Alan Connor

unread,
Jun 6, 2005, 2:47:37 AM6/6/05
to
On comp.unix.shell, in <0k3dn2-...@rogers.com>, "Chris F.A. Johnson" wrote:

<snip>

$ wget --spider http://cfaj.freeshell.org/src/scripts/cfajfuncs
--23:38:59-- http://cfaj.freeshell.org/src/scripts/cfajfuncs
=> `cfajfuncs'
Resolving cfaj.freeshell.org... done.
Connecting to cfaj.freeshell.org[192.94.73.2]:80... failed: Connection timed out.
Retrying.

--23:42:10-- http://cfaj.freeshell.org/src/scripts/cfajfuncs
(try: 2) => `cfajfuncs'
Connecting to cfaj.freeshell.org[192.94.73.2]:80... failed: Connection timed out.
Retrying.

# nmap 192.94.73.2 -p 80

Starting nmap V. 2.54BETA30 ( www.insecure.org/nmap/ )
Note: Host seems down. If it is really up, but blocking our ping probes, try -P0

Nmap run completed -- 1 IP address (0 hosts up) scanned in 30 seconds

# nmap -P0 192.94.73.2 -p 80

Starting nmap V. 2.54BETA30 ( www.insecure.org/nmap/ )
Interesting ports on otaku.freeshell.org (192.94.73.2):
Port State Service
80/tcp filtered http


Nmap run completed -- 1 IP address (1 host up) scanned in 36 seconds

---------------------------------------------------

AC


Alan Connor

unread,
Jun 6, 2005, 3:12:48 AM6/6/05
to
On comp.unix.shell, in <0k3dn2-...@rogers.com>, "Chris F.A. Johnson" wrote:

<snip dialog links>

> Not good; see <http://torfree.net/~chris/dialog.html>
> (beware, the images are quite large).
>
> The problems with dialog include:
>
> It uses the entire screen for one dialog box

So what?

Your script still takes over the entire tty or pty.

> It assumes that the font has line-drawing characters

Which it usually does.

> The background colour cannot be changed

Neither can the menu color.

Not the end of the world.

And a C programmer like William Park could add that functionality
in a very short time.

>
> With a few shell functions, a much more flexible
> system can be put together. The following script
> uses a stripped down set of functions from my
> library. It doesn't have all the functionality of
> the q18 script, but it shows that it is possible.
>
> The script requires ANSI terminal emulation
> (xterm/rxvt, linux, vt100, etc...) and a POSIX
> shell.

But will it scroll beyond a single screenful, which dialog does?

No.

<snip>

I've been learning to use dialog, and it is pretty nice, and
doesn't take the level of shell programming knowledge that
your approach requires.

AC

Alan Connor

unread,
Jun 6, 2005, 4:38:42 AM6/6/05
to
On comp.unix.shell, in
<1117921345....@g14g2000cwa.googlegroups.com>,
"googl...@hotpop.com" wrote:

I've got a bunch more, but you seem to have vanished,
so I will keep them for myself and future queries
along these lines.

dig -x 68.238.115.131
pool-68-238-115-131.atl.dsl-w.verizon.net

Have any idea how few people post here from that modem pool?

You are the only one in the last 5 months.

AC

Thomas Dickey

unread,
Jun 6, 2005, 5:28:33 AM6/6/05
to
Chris F.A. Johnson <cfajo...@gmail.com> wrote:
> On 2005-06-05, comp.unix.shell wrote:
>> Dialog is good to use it. You can see all examples in dialog directory
>> (/usr) or see online at
>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/ch04sec11.html
>>
>> and
>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/scripts/q18

> Not good; see <http://torfree.net/~chris/dialog.html> (beware, the
> images are quite large).

furthermore, it's a poor example. Here's a sample of what it can do:

http://invisible-island.net/dialog/dialog.png

> The problems with dialog include:

> It uses the entire screen for one dialog box

no. Read the manpage.

> It assumes that the font has line-drawing characters

not this either (it would like to use them, but curses will use +'s or -'s
if the terminal doesn't support them). Of course that assumes that one has
a proper terminal description.

> The background colour cannot be changed

It's configurable, of course. There are a few sample config files in dialog's
source tarball.

> With a few shell functions, a much more flexible system can be put
> together. The following script uses a stripped down set of
> functions from my library. It doesn't have all the functionality
> of the q18 script, but it shows that it is possible.

> The script requires ANSI terminal emulation (xterm/rxvt, linux,
> vt100, etc...) and a POSIX shell.

If you're not even setting $TERM properly, the above comment can only
be viewed with some caution.

bye.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Thomas Dickey

unread,
Jun 6, 2005, 5:32:20 AM6/6/05
to
Alan Connor <zzz...@xxx.yyy> wrote:

> Hope one of those sites tells how to change the colors
> of the box and background, etc. There's nothing in the
> man page about it.

only obliquely - the configuration file samples have comments

Alan Connor

unread,
Jun 6, 2005, 6:00:52 AM6/6/05
to
On comp.unix.shell, in <11a8614...@corp.supernews.com>, "Thomas Dickey" wrote:
>
>
> Alan Connor <zzz...@xxx.yyy> wrote:
>
>> Hope one of those sites tells how to change the colors
>> of the box and background, etc. There's nothing in the
>> man page about it.
>
> only obliquely - the configuration file samples have comments

Thanks. Might be worthwhile re-compiling to get rid of
that glaring blue, which is an eye-shocker for someone
who usually runs in an xterm.

Ever use an xterm? Pretty nifty.

:-))


For the newbies: Thomas Dickey wrote and
maintains xterm, the model upon which all other
x-terminal-emulators are based and the standard against
which they are judged.

----------

http://invisible-island.net/dialog/

And I see that he is also maintaining and improving dialog.

THANKS!

-----------

I run dialog in screen in an xterm, and find the visual
bell flashes between main menu and sub menus and back
again very annoying (running the main menu in a while
true loop). I set the screen vbell to audio and
this didn't help, and tried "setterm blength 0" and
that didn't work.

Could this be the xterm or dialog? There's an option
for making the bell happen in dialog, but not the
reverse. Apparently, the bell is audible by default
in xterm.

>
> --
> Thomas E. Dickey
> http://invisible-island.net

> ftp://invisible-island.net

Bet that's a treasure trove. On my way!

AC


Chris F.A. Johnson

unread,
Jun 6, 2005, 12:06:06 PM6/6/05
to
On 2005-06-06, Thomas Dickey wrote:
> Chris F.A. Johnson <cfajo...@gmail.com> wrote:
>> On 2005-06-05, comp.unix.shell wrote:
>>> Dialog is good to use it. You can see all examples in dialog directory
>>> (/usr) or see online at
>>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/ch04sec11.html
>>>
>>> and
>>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/scripts/q18
>
>> Not good; see <http://torfree.net/~chris/dialog.html> (beware, the
>> images are quite large).
>
> furthermore, it's a poor example. Here's a sample of what it can do:
>
> http://invisible-island.net/dialog/dialog.png

A screen shot tells very little about its behaviour. Where's the
script that generates it?

>> The problems with dialog include:
>
>> It uses the entire screen for one dialog box
> no. Read the manpage.
>
>> It assumes that the font has line-drawing characters
>
> not this either (it would like to use them, but curses will use +'s or -'s
> if the terminal doesn't support them). Of course that assumes that one has
> a proper terminal description.

The TERM variable makes no difference. Or, rather, it seems to be
haphazard. If I played around with it, I could probably get it
working properly, but the interface is so cumbersome, I have no
desire to devote any time to it. There are much better ways of
doing anything dialog can do.

>> The background colour cannot be changed
>
> It's configurable, of course. There are a few sample config files in dialog's
> source tarball.
>
>> With a few shell functions, a much more flexible system can be put
>> together. The following script uses a stripped down set of
>> functions from my library. It doesn't have all the functionality
>> of the q18 script, but it shows that it is possible.
>
>> The script requires ANSI terminal emulation (xterm/rxvt, linux,
>> vt100, etc...) and a POSIX shell.
>
> If you're not even setting $TERM properly, the above comment can only
> be viewed with some caution.

Setting TERM is irrelevant; some older systems do not have tput,
or any other means of generating terminal-dependent behaviour.
Besides, the manner in which tput returns any information is not
specified by POSIX.

With the overwhelming preponderance of ANSI terminal emulation, it
makes a lot of sense to code for it. Should anyone need to
accommodate other emulations, it's a relatively simple matter.
Although I would welcome such a request, I have not had to code
for non-ANSI terminals in more than 10 years.

dfr...@mtxia.com

unread,
Jun 6, 2005, 12:21:37 PM6/6/05
to

There is always the old reliable shell curses and French menus shell
function libraries:

http://dfrench.tripod.com/curses.txt
http://dfrench.tripod.com/ksh93curses.txt

The ksh93 may or may not work with bash, I haven't tried it, however
the bourne shell version (curses.txt) certainly will work.


Dana French

Michael Heiming

unread,
Jun 6, 2005, 2:13:46 PM6/6/05
to
In comp.unix.shell Chris F.A. Johnson <cfajo...@gmail.com>:
> On 2005-06-06, Thomas Dickey wrote:
>> Chris F.A. Johnson <cfajo...@gmail.com> wrote:
>>> On 2005-06-05, comp.unix.shell wrote:
>>>> Dialog is good to use it. You can see all examples in dialog directory
>>>> (/usr) or see online at
>>>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/ch04sec11.html
>>>>
>>>> and
>>>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/scripts/q18
>>
>>> Not good; see <http://torfree.net/~chris/dialog.html> (beware, the
>>> images are quite large).
>>
>> furthermore, it's a poor example. Here's a sample of what it can do:
>>
>> http://invisible-island.net/dialog/dialog.png

> A screen shot tells very little about its behaviour. Where's the
> script that generates it?

Dunno, there are tons of examples coming with the dialog source
package, like this file/dir select box which looks quite nice:

# $Id: fselect-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
: ${DIALOG=dialog}

FILE=`$DIALOG --stdout --title "Please choose a file" --fselect
$HOME/ 14 48`

case $? in
0)
echo "\"$FILE\" chosen";;
1)
echo "Cancel pressed.";;
255)
echo "Box closed.";;
esac

Something like this would require some work to get it working
without dialog or alike. It might not be perfect but does allow
setting up good/reliable dialog boxes in a matter of
seconds/minutes, without having your shell programming
experience.

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvp...@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'

#bofh excuse 249: Unfortunately we have run out of
bits/bytes/whatever.

Chris F.A. Johnson

unread,
Jun 7, 2005, 10:49:42 AM6/7/05
to

I have never been able to get either one to work with bash -- or
ksh93. I've tried on FreeBSD as well as Linux.

dfr...@mtxia.com

unread,
Jun 7, 2005, 2:24:50 PM6/7/05
to

Chris F.A. Johnson wrote:
> On 2005-06-06, dfr...@mtxia.com wrote:
> > googl...@hotpop.com wrote:
> >> Anyone out there use Suse's Yast tool from command line? I want to
> >> create some simple command line tools for adding users into a database,
> >> but want to spice it up a little like Yast. Moreover, I want to keep
> >> this really, really simple by using Bash. Is there a program I can
> >> download that lets me create scripts in Bash to give me a Yast-like
> >> experience? Also, you Novell-heads out there (said nicely -- I once was
> >> a CNE) you may remember the Novell command line text GUI (TUI)
> >> environment that is similar to Yast.
> >>
> >> Anyone got an answer? Much appreciated. Thanks.
> >
> > There is always the old reliable shell curses and French menus shell
> > function libraries:
> >
> > http://dfrench.tripod.com/curses.txt
> > http://dfrench.tripod.com/ksh93curses.txt
> >
> > The ksh93 may or may not work with bash, I haven't tried it, however
> > the bourne shell version (curses.txt) certainly will work.
>
> I have never been able to get either one to work with bash -- or
> ksh93. I've tried on FreeBSD as well as Linux.

Is there an error displayed? If you would, please try it again,
capture the results and send them to me so I can fix it.

Dana French
dfr...@ridmail.com

Alan Connor

unread,
Jun 7, 2005, 6:32:21 PM6/7/05
to
On comp.unix.shell, in <1118168690....@g47g2000cwa.googlegroups.com>, "dfr...@mtxia.com" wrote:

<snip>

> Is there an error displayed? If you would, please try it again,
> capture the results and send them to me so I can fix it.
>
> Dana French
> dfr...@ridmail.com
>

http://dfrench.tripod.com/curses.txt

Looks really interesting, Dana, and I thought I'd give
it a try, sending bug reports to you (if any), but got
this when I tried to retrieve the sh tar.gz file:

$ ncftp ftp://ftp.aig.vialink.com
Resolving ftp.aig.vialink.com...
Unknown host "ftp.aig.vialink.com".


AC

dfr...@mtxia.com

unread,
Jun 7, 2005, 10:27:45 PM6/7/05
to


The addresses that are in the top portion of the uuencoded "curses.txt"
file are incorrect, but if you have the "curses.txt" file, you have the
library. You just need to uudecode the "curses.txt" file to generate
the tar.gz file.

uudecode curses.txt


Dana French

Alan Connor

unread,
Jun 7, 2005, 11:21:54 PM6/7/05
to
On comp.unix.shell, in <1118197665.1...@g49g2000cwa.googlegroups.com>, "dfr...@mtxia.com" wrote:
>
>
>
> Alan Connor wrote:
>> On comp.unix.shell, in <1118168690....@g47g2000cwa.googlegroups.com>, "dfr...@mtxia.com" wrote:
>>
>> <snip>
>>
>> > Is there an error displayed? If you would, please try it again,
>> > capture the results and send them to me so I can fix it.
>> >
>> > Dana French
>> > dfr...@ridmail.com
>> >
>>
>> http://dfrench.tripod.com/curses.txt
>>
>> Looks really interesting, Dana, and I thought I'd give
>> it a try, sending bug reports to you (if any), but got
>> this when I tried to retrieve the sh tar.gz file:
>>
>> $ ncftp ftp://ftp.aig.vialink.com
>> Resolving ftp.aig.vialink.com...
>> Unknown host "ftp.aig.vialink.com".
>>
>>
>
>

> The addresses that are in the top portion of the
> uuencoded "curses.txt" file are incorrect,

They aren't at the top of that file, they are at the
top of your webpage, which also contains that file.

> but if you
> have the "curses.txt" file, you have the library.
> You just need to uudecode the "curses.txt" file to
> generate the tar.gz file.
>
> uudecode curses.txt
>
>
> Dana French
>

I don't understand. Your webpage has these ftp addresses
and says that one can obtain the files there:

http://dfrench.tripod.com/curses.txt

<quote>

This file is in "uuencoded" format so that it can
be easily E-mailed to requestors. This same file may be
ftp'd from:
ftp://ftp.aig.vialink.com/ftp/tech_support/sh/curses.uue

A compressed tar file may be downloaded from:
ftp://ftp.aig.vialink.com/ftp/tech_support/sh/curses.tar.Z

A gzip'd tar file may be downloaded from:
ftp://ftp.aig.vialink.com/ftp/tech_support/sh/curses.tar.gz

</quote>

If those links aren't any good any more (and they aren't,
which you must have know for a long while because the
damn server doesn't exist!), then why the HELL
haven't you removed them from a webpage that you are
posting on the Usenet?!!

I am not inclined to run executables created by someone
that is a sloppy and lazy and irresponsible as you seem
to be.

No doubt what Chris FAJ says is true: They don't work.

Probably because you couldn't be bothered to remove old
and dysfunctional functions from the script.

AC

Thomas Dickey

unread,
Jun 8, 2005, 7:27:28 AM6/8/05
to
Alan Connor <zzz...@xxx.yyy> wrote:
> I run dialog in screen in an xterm, and find the visual
> bell flashes between main menu and sub menus and back
> again very annoying (running the main menu in a while
> true loop). I set the screen vbell to audio and
> this didn't help, and tried "setterm blength 0" and
> that didn't work.

> Could this be the xterm or dialog? There's an option
> for making the bell happen in dialog, but not the
> reverse. Apparently, the bell is audible by default
> in xterm.

That sounds like dialog - most of the error bells/flashes aren't configurable
(something to look into).

Alan Connor

unread,
Jun 8, 2005, 8:07:30 AM6/8/05
to
On comp.unix.shell, in <11adlh0...@corp.supernews.com>, "Thomas Dickey" wrote:
>
>
> Alan Connor <zzz...@xxx.yyy> wrote:
>> I run dialog in screen in an xterm, and find the visual
>> bell flashes between main menu and sub menus and back
>> again very annoying (running the main menu in a while
>> true loop). I set the screen vbell to audio and
>> this didn't help, and tried "setterm blength 0" and
>> that didn't work.
>
>> Could this be the xterm or dialog? There's an option
>> for making the bell happen in dialog, but not the
>> reverse. Apparently, the bell is audible by default
>> in xterm.
>
> That sounds like dialog - most of the error bells/flashes aren't configurable
> (something to look into).
>

Thanks.

I think you are right: Tried it in a plain tty and got
the same thing.

AC

Chris F.A. Johnson

unread,
Jun 8, 2005, 4:33:22 PM6/8/05
to

I may have been a little sweeping with my statement. However,
neither will work with some of the OSs I use:

SunOS 4.1 does not have tput.

In FreeBSD and NetBSD, tput uses termcap names rather than
terminfo names (or is it the other way round?). The BSD
equivalent of "tput cup" is "tput cm", but it doesn't produce
a template when called without arguments.

That leaves Linux (at the moment, I'm using Ubuntu).

Running this script:

. curses.sh
initscr
# example useage follows
move 10 10
clrtoeol
addstr "Hello World!!!"
refresh
endwin

...produces:

/usr/local/bin/curses.sh: line 102: domainname: command not found

Otherwise, it seems to work.

$ ./rundemo.sh
./demo.sh[50]: domainname: not found
./demo.sh[50]: 1 \* 2 : unexpected `\'
./demo.sh[50]: 1 \* 2 + 6 : unexpected `\'
./demo.sh[50]: 1 \* 2 : unexpected `\'
./demo.sh[50]: 1 \* 2 + 6 : unexpected `\'
./demo.sh[50]: 1 \* 2 : unexpected `\'
./demo.sh[50]: 1 \* 2 + 6 : unexpected `\'
./demo.sh[50]: 1 \* 2 : unexpected `\'
./demo.sh[50]: 1 \* 2 + 6 : unexpected `\'
./demo.sh[50]: 1 \* 2 : unexpected `\'

...ad infinitum (while continually flashing in reverse at the top
of the screen):

PGMdemo Communications Control System chris@xword
SCR Written by Dana French (dfr...@vialink.com) 06/08/05

$ pwd
/home/chris/work/curses/ksh93
$ ./rundemo.sh
bash: ./rundemo.sh: /usr/dt/bin/dtksh: bad interpreter: No such file or directory

googl...@hotpop.com

unread,
Jun 12, 2005, 8:57:15 PM6/12/05
to
Alan Connor wrote:
> I've got a bunch more, but you seem to have vanished,
> so I will keep them for myself and future queries
> along these lines.
>
> dig -x 68.238.115.131
> pool-68-238-115-131.atl.dsl-w.verizon.net
>
> Have any idea how few people post here from that modem pool?
>
> You are the only one in the last 5 months.

<side note>
Not vanished. Just employed and overloaded with work, then grossly
underpaid, tied to my wife's neighborhood so I cannot move away for a
better job. At nights I'm working in web development on a very long,
drawn out project that supposedly will be similar in some respects to
SugarCRM, but easier to get started with and customize. So, not
vanished, just busy.
</side note>

Actually, barring anything whipped up in C besides dialog, which kinda
turned me off because of how ugly it was, I moved on to building
something in Bash. I made "tuimenuwidget". Perhaps when I perfect it a
little more I might put it up on SourceForge and let others improve
upon it. It uses ordinary Linux Bash and just might work on other
*nixes. It uses VT100 commands, but does so in a way that works best
with most terminals. I do use color, but it's not critical if the
terminal doesn't show it. Instead of graphics characters, which
gnome-terminal doesn't display, I use inverse and draw boxes with it.
For menu choices, I move a ">" up and down beside it and you hit Enter
to choose.

Alan Connor

unread,
Jun 12, 2005, 9:37:11 PM6/12/05
to
On comp.unix.shell, in
<1118624235....@o13g2000cwo.googlegroups.com>,
"googl...@hotpop.com" wrote:

> Alan Connor wrote:
>
>> I've got a bunch more, but you seem to have vanished, so I
>> will keep them for myself and future queries along these
>> lines.
>>
>> dig -x 68.238.115.131
>> pool-68-238-115-131.atl.dsl-w.verizon.net
>>
>> Have any idea how few people post here from that modem pool?
>>
>> You are the only one in the last 5 months.
>
><side note> Not vanished. Just employed and overloaded with
>work, then grossly underpaid, tied to my wife's neighborhood
>so I cannot move away for a better job. At nights I'm working
>in web development on a very long, drawn out project that
>supposedly will be similar in some respects to SugarCRM, but
>easier to get started with and customize. So, not vanished, just
>busy. </side note>

Good enough.

>
> Actually, barring anything whipped up in C besides
> dialog, which kinda turned me off because of how ugly it
> was, I moved on to building something in Bash. I made
> "tuimenuwidget". Perhaps when I perfect it a little more I
> might put it up on SourceForge and let others improve upon
> it. It uses ordinary Linux Bash and just might work on other
> *nixes. It uses VT100 commands, but does so in a way that
> works best with most terminals. I do use color, but it's not
> critical if the terminal doesn't show it. Instead of graphics
> characters, which gnome-terminal doesn't display, I use inverse
> and draw boxes with it. For menu choices, I move a ">" up and
> down beside it and you hit Enter to choose.
>

Since your OP, I have learned to use dialog pretty well, and
frankly prefer plain, text, case menus, with basic ascii
art. I'll be posting another of my CLI series that covers the
creating of menus and sub-menus with bash, sometime soon.

However, your tuimenuwidget sounds very interesting, and I'd
love to see the source and play with it.

"tui" = "textmode user interface"? I like it. I use what's
called a "TIDE" = "Textmode Integrated Desktop Environment",
which is, of course, based on the TUI. Much faster and
more versatile and less consuming-of-system-resources than
a GIDE like Gnome.

Don't really have a problem with colors, just as long as they
enhance usability (rather than just being eye-candy) and
are very configurable and the app will still be usable without
them.

Cheers,

AC

--
alanconnor AT earthlink DOT net
Use your real return address or I'll never know you
even tried to mail me. http://tinyurl.com/2t5kp
~

Alan Connor

unread,
Jun 12, 2005, 10:06:43 PM6/12/05
to
On comp.unix.shell, in <br5re.3555$jX6....@newsread2.news.pas.earthlink.net>, "Alan Connor" wrote:

<snip>

> Since your OP, I have learned to use dialog pretty well, and
> frankly prefer plain, text, case menus, with basic ascii
> art. I'll be posting another of my CLI series that covers the
> creating of menus and sub-menus with bash, sometime soon.

That would be on comp.os.linux.misc

<snip>

AC

Alan Connor

unread,
Jun 13, 2005, 3:01:32 AM6/13/05
to
On comp.unix.shell, in <0k3dn2-...@rogers.com>, "Chris F.A. Johnson" wrote:
>
>

<snip>

>


> Not good; see <http://torfree.net/~chris/dialog.html>
> (beware, the images are quite large).
>
> The problems with dialog include:
>
> It uses the entire screen for one dialog box It
> assumes that the font has line-drawing characters The
> background colour cannot be changed
>
> With a few shell functions, a much more flexible system can
> be put together. The following script uses a stripped down
> set of functions from my library. It doesn't have all the
> functionality of the q18 script, but it shows that it is
> possible.
>
> The script requires ANSI terminal emulation (xterm/rxvt,
> linux, vt100, etc...) and a POSIX shell.
>
>

> ######### menu-demo ###########

#!/bin/sh

> Shell Scripting Recipes: A Problem-Solution Approach, 2005,
> Apress <http://www.torfree.net/~chris/books/cfaj/ssr.html>

Have to admit that these menus are much nicer than dialogs.

AC

0 new messages