Thanks!
That is exactly what I needed. I didn't however need the full 
functionality of your script but only to know if the app is there or 
not so I used:

app_test(){

    x="`type $1`"
   
    case "$x" in
          *"not found")
             return 1
             break ;;
          *)
             return 0
             break ;;
    esac
}

My newest version of the debug script is posted at
http://home.pacbell.net/rcw1/lrp/debug/debug.html
http://home.pacbell.net/rcw1/lrp/files/debug-0.7.sh.txt

This includes a new functionality to purify the output of IP 
addresses for those who don't feel comfortable sending them to the 
list. I don't feel like leaving the ip address in is a security risk 
(is there something I don't know?) and I have been helped in finding 
typos by the list by sending them in. But, for those who feel 
uncomfortable with that kind of thing, the script will put in place 
holders instead of IPs for everything but some internal net ips. Let 
me know if it is helpful and as always input is welcome.
Robert Williams

>
>You can also use the 'type' shell built-in to look for programs, but it's
>output isn't in as convinent a form as the output of 'which' (which
>convinently returns nothing if the program is not found).  Of course, you
>could always cheat and make your own which from type and shell-script:
>
>#!/bin/sh
>
>x="`type $1`"
>
>case "$x" in
>         *builtin)       ;;
>         *"not found")   ;;
>         *)
>                 set -- $x
>                 eval echo \${$#}
>                 ;;
>esac
>
>Charles Steinkuehler
>http://lrp.steinkuehler.net
>http://c0wz.steinkuehler.net (lrp.c0wz.com mirror)
>
>
>
>_______________________________________________
>Leaf-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/leaf-user


_______________________________________________
Leaf-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user

Reply via email to