Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxx hicom, wwwxxx con, WWWXXXCON, can we use where clause with droo, www. xxxxxckR, cyradm subscribe folder, wwwcxxx ips , wwwcxxx ips , wwwcxxx .comajk.com., wwwxxx

Links

XODOX
Impressum

#1: How To Spice Up Menus in Bash

Posted on 2005-06-04 23:42:25 by googlemike

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.

Report this message

#2: Re: How To Spice Up Menus in Bash

Posted on 2005-06-04 23:46:17 by Michael Heiming

In comp.unix.shell googlemike@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 zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 108: The air conditioning water supply pipe
ruptured over the machine room

Report this message

#3: Re: How To Spice Up Menus in Bash

Posted on 2005-06-05 00:08:10 by cfajohnson

On 2005-06-04, googlemike@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.

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>

Report this message

#4: Re: How To Spice Up Menus in Bash

Posted on 2005-06-05 00:12:36 by cfajohnson

On 2005-06-04, Michael Heiming wrote:
> In comp.unix.shell googlemike@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.

--
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>

Report this message

#5: Re: How To Spice Up Menus in Bash

Posted on 2005-06-05 08:45:45 by Michael Heiming

In comp.unix.shell Chris F.A. Johnson <cfajohnson@gmail.com>:
> On 2005-06-04, Michael Heiming wrote:
>> In comp.unix.shell googlemike@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 zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 16: somebody was calculating pi on the server

Report this message

#6: Re: How To Spice Up Menus in Bash

Posted on 2005-06-05 09:02:25 by rockdalinux

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/l sst/ch04sec11.html

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

Hope this helps

Report this message

#7: Re: How To Spice Up Menus in Bash

Posted on 2005-06-05 10:04:26 by Alan Connor

On comp.unix.shell, in
<1117954945.939094.313940@o13g2000cwo.googlegroups.com>,
"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/l sst/ch04sec11.html

> and
> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/l sst/scripts/q18
>
> Hope this helps
>

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

Report this message

#8: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 07:30:08 by cfajohnson

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/l sst/ch04sec11.html
>
> and
> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/l sst/scripts/q18

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


--
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>

Report this message

#9: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 08:47:37 by Alan Connor

On comp.unix.shell, in <0k3dn2-p34.ln1@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

Report this message

#10: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 09:12:48 by Alan Connor

On comp.unix.shell, in <0k3dn2-p34.ln1@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

Report this message

#11: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 10:38:42 by Alan Connor

On comp.unix.shell, in
<1117921345.223049.3240@g14g2000cwa.googlegroups.com>,
"googlemike@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.

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

Report this message

#12: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 11:28:33 by Thomas Dickey

Chris F.A. Johnson <cfajohnson@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/l sst/ch04sec11.html
>>
>> and
>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/l sst/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

Report this message

#13: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 11:32:20 by Thomas Dickey

Alan Connor <zzzzzz@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

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

Report this message

#14: Dialog (was: Re: How To Spice Up Menus in Bash)

Posted on 2005-06-06 12:00:52 by Alan Connor

On comp.unix.shell, in <11a8614scab3s96@corp.supernews.com>, "Thomas Dickey" wrote:
>
>
> Alan Connor <zzzzzz@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

Report this message

#15: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 18:06:06 by cfajohnson

On 2005-06-06, Thomas Dickey wrote:
> Chris F.A. Johnson <cfajohnson@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/l sst/ch04sec11.html
>>>
>>> and
>>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/l sst/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.

--
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>

Report this message

#16: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 18:21:37 by dfrench

googlemike@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.


Dana French

Report this message

#17: Re: How To Spice Up Menus in Bash

Posted on 2005-06-06 20:13:46 by Michael Heiming

In comp.unix.shell Chris F.A. Johnson <cfajohnson@gmail.com>:
> On 2005-06-06, Thomas Dickey wrote:
>> Chris F.A. Johnson <cfajohnson@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/l sst/ch04sec11.html
>>>>
>>>> and
>>>> http://cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/l sst/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 zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 249: Unfortunately we have run out of
bits/bytes/whatever.

Report this message

#18: Re: How To Spice Up Menus in Bash

Posted on 2005-06-07 16:49:42 by cfajohnson

On 2005-06-06, dfrench@mtxia.com wrote:
> googlemike@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.

--
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>

Report this message

#19: Re: How To Spice Up Menus in Bash

Posted on 2005-06-07 20:24:50 by dfrench

Chris F.A. Johnson wrote:
> On 2005-06-06, dfrench@mtxia.com wrote:
> > googlemike@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
dfrench@ridmail.com

Report this message

#20: Re: How To Spice Up Menus in Bash

Posted on 2005-06-08 00:32:21 by Alan Connor

On comp.unix.shell, in <1118168690.465104.62870@g47g2000cwa.googlegroups.com>, "dfrench@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
> dfrench@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

Report this message

#21: Re: How To Spice Up Menus in Bash

Posted on 2005-06-08 04:27:45 by dfrench

Alan Connor wrote:
> On comp.unix.shell, in <1118168690.465104.62870@g47g2000cwa.googlegroups.com>, "dfrench@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
> > dfrench@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, 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

Report this message

#22: Re: How To Spice Up Menus in Bash

Posted on 2005-06-08 05:21:54 by Alan Connor

On comp.unix.shell, in <1118197665.102590.308060@g49g2000cwa.googlegroups.com>, "dfrench@mtxia.com" wrote:
>
>
>
> Alan Connor wrote:
>> On comp.unix.shell, in <1118168690.465104.62870@g47g2000cwa.googlegroups.com>, "dfrench@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
>> > dfrench@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

Report this message

#23: Re: Dialog

Posted on 2005-06-08 13:27:28 by Thomas Dickey

Alan Connor <zzzzzz@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).

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

Report this message

#24: Re: Dialog

Posted on 2005-06-08 14:07:30 by Alan Connor

On comp.unix.shell, in <11adlh0gu7ffvef@corp.supernews.com>, "Thomas Dickey" wrote:
>
>
> Alan Connor <zzzzzz@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.

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

AC

Report this message

#25: Re: How To Spice Up Menus in Bash

Posted on 2005-06-08 22:33:22 by cfajohnson

On 2005-06-07, dfrench@mtxia.com wrote:
>
> Chris F.A. Johnson wrote:
>> On 2005-06-06, dfrench@mtxia.com wrote:
>> > googlemike@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.

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 (dfrench@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


--
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>

Report this message

#26: Re: How To Spice Up Menus in Bash

Posted on 2005-06-13 02:57:15 by googlemike

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.

Report this message

#27: Re: How To Spice Up Menus in Bash

Posted on 2005-06-13 03:37:11 by Alan Connor

On comp.unix.shell, in
<1118624235.308216.31620@o13g2000cwo.googlegroups.com>,
"googlemike@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
~

Report this message

#28: Re: How To Spice Up Menus in Bash

Posted on 2005-06-13 04:06:43 by Alan Connor

On comp.unix.shell, in <br5re.3555$jX6.1033@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

Report this message

#29: Re: How To Spice Up Menus in Bash

Posted on 2005-06-13 09:01:32 by Alan Connor

On comp.unix.shell, in <0k3dn2-p34.ln1@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

> 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
>
>

> -- 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>

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

AC

Report this message