On Sat, Sep 21, 2002 at 10:55:48AM +0200, Preben Randhol wrote: > Bob Proulx <[EMAIL PROTECTED]> wrote on 19/09/2002 (18:07) : > > type mozilla > > > > command -v mozilla > > Isn't it kind of stupid to suggest a bash only solution? Especially if > you want to use this in a script like: > > #!/bin/sh > BROWSER=`which mozilla`
Well, obviously if you're using #! /bin/sh then you don't need to worry about what csh will make of it. Actually 'type' works in bash, ash, and zsh, while 'command -v' works in bash and ash. Both are extensions to the strict POSIX shell syntax, though. Unfortunately there is no easy portable way to do 'which'. On some systems and shells you'll find 'which' outputting extra stuff (say, "mozilla is /usr/bin/mozilla"), which will break your script. At work I resorted to writing a short shell script which iterates through $PATH manually in order to make 'which' work everywhere. > Although it also puzzels me why people use mozilla when galeon has a > much better interface. I can't stand galeon's interface: it feels too clunky and doesn't respond to me in the way I want. mozilla's interface is much smoother for me. That should prove that it's a matter of taste. :) -- Colin Watson [[EMAIL PROTECTED]] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]