Here is a sample script

--------------Start ------------------------
#!/bin/sh

if test "$OPSYSTEM" = "TANDEM"
then
        VIEWER="more"
else
        VIEWER="less"
fi

menu=""

while test "$menu" != "x"
do

        tput clear
        tput smso
        echo 'Sample menu'
        tput rmso
        echo '1.       Show disk space'
        echo '2.       Show uptime'
        echo '3.       Show /var/log/messages'
        echo '4.       Show /etc/hosts'
        echo '5.       Show network configuration'
        echo 'x.       Exit to shell'
        echo ''
        echo 'Select Option [1 - 5 or x to Return] :'
        tput cup 10 38

        read menu

        tput clear

        case $menu in

        '1')
                df -H
        ;;

        '2')
                uptime
        ;;

        '3')
                tail /var/log/messages
        ;;


        '4')
                cat /etc/hosts | $VIEWER
        ;;

        '5')
                ifconfig | $VIEWER
        ;;

        esac

        echo '**    Press <ENTER>   **'
        read press
done

--------------End ------------------------

To use the menu create a file call menu.sh and paste the above in.
Save the file, using chmod add the execute permission.  Run the script.

It should display a menu of 5 options.  The header should be printed in
bold.  The cursor should be placed after the statement
"'Select Option [1 - 5 or x to Return] :".

 -----Original Message-----
From: Axel Liljencrantz [mailto:[EMAIL PROTECTED] 
Sent: 18 April 2006 12:36
To: ray hammond
Cc: [email protected]
Subject: Re: [Fish-users] tput commands

On 4/17/06, ray hammond <[EMAIL PROTECTED]> wrote:
>
>
>
> I using fish 1.21.4 on Mandriva 2006, I am getting some odd behavior using
> the tput command with my menu driven shell scripts.
>
>
>
> Examples
>
>
>
> "tput cur 24,22", this should move the cursor to row 24 column 22.  The
> cursor moves to the correct row, but seems to fix the column.
>
>
>
> "tput smso" and "tput rmso", this command has no effect.  It should set
the
> terminal bold (smso) and bold-off (rmso).
>

It sounds like fish resets the terminal when it shouldn't. Could you
provide me with a short example script and how to use it so that I can
test further?

--
Axel


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.3/316 - Release Date: 17/04/2006




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to