On 4/18/06, ray hammond <[EMAIL PROTECTED]> wrote: > 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] :".
This works for me, except that the cursor is placed two lines below the specified option. But that is as it should be, it is placed on line 10 as per the tput command. Also, my terminal doesn't bold the menu, it reverses the video, but smso only specifies 'standout mode'. Is it the case that this does not work on your system when the command is started from fish, but it does work when started from bash? If so, try adding a 'reset' command at the top. If this helps, fish must leave your terminal in a wonky state on startup. -- Axel ------------------------------------------------------- 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&kid0944&bid$1720&dat1642 _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
