*BSD News Article 41701


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.netspace.net.au!serval.net.wsu.edu!netnews.nwnet.net!oracle.pnl.gov!osi-east2.es.net!lll-winken.llnl.gov!fnnews.fnal.gov!uwm.edu!math.ohio-state.edu!deshaw.com!christos
From: christos@deshaw.com (Christos Zoulas)
Subject: Re: FBSD 2.0-950112: Missing "which"
Message-ID: <D2xDpA.K5o@deshaw.com>
Sender: usenet@deshaw.com
Nntp-Posting-Host: cs4
Organization: D. E. Shaw & Co.
References: <3g386a$mfq@Owl.nstn.ca>
Date: Tue, 24 Jan 1995 19:48:46 GMT
Lines: 26

In article <3g386a$mfq@Owl.nstn.ca> digdon@Snoopy.UCIS.Dal.Ca (Mike Digdon) writes:
>I tend to use the "which" command quite a lot.  Before I had time to install
>bash (I just set up my machine), I had to use csh.  "which" seems to be a csh
>built-in, so I was very surprised to find that "which" stopped working once
>I was running bash.
>
>On my SunOS system at work, "which" is found in /usr/ucb, and is not a
>built-in function.  So, before I write my own verion of "which", is there
>some source for this floating around somewhere?  I tried to find some in
>various places, but was unsuccessful.
>
>If there isn't and I do end up writing such a beast (well, which isn't THAT
>complicated), would anyone be interested in it?
>

which is type in bourne like shells... Here's a which for you:

#!/bin/csh -f
which $*

or if you prefer

#!/usr/sh 
type "$@"

christos