> I am testing for the following apps but I don't have arp or setserial > installed on my system so I don't know their path. If someone would > let me know the path to arp and setserial I would appreciate it. > > I am testing for the apps using this format. > [ -f $NETSTAT ] && do_task $NETSTAT -an || error $NETSTAT > On the apps I don't know the path to I am using: > do_task setserial -a /dev/ttyS0 2>>$FILE > and writing the error to the output file. > > If there is a better way please let me know.
There's always the ever-handy 'which' command, but this doesn't exist on most LRP/LEAF distributions. I've added which to busybox in the Dachstein CD release (it will be in the floppy Dachstein releases, as soon as I get around to burning another image). 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