lkml.org 
[lkml]   [2000]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: 2.2.18pre12 fix for some distros
On Sat, Sep 30, 2000 at 03:13:02PM +0100, Alan Cox wrote:
> > Please replace which with "command -v" which is required by SuS in /bin/sh.
>
> command -v breaks on some setups. One problem can be seen easily by doing this
>
> # command -v ls
> alias ls='ls --color=tty'

.bashrc is only read for interactive shells. Besides, if which is a bash
alias as well,

$ command -v which
alias which='type -path'
$

it will break too,

$ which which
$

I think what you can do is to ignore the value returned by command -v, and
just use it is an indication that this thing exists. After all, if you can
find it using command -v, just calling it will work too. Something like

if command -v gcc272 > /dev/null 2> /dev/null; then echo gcc272; else \
echo gcc; fi
--
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.108 / U:1.496 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site