From owner-freebsd-current Fri Mar 3 12:31:18 2000 Delivered-To: freebsd-current@freebsd.org Received: from dorifer.heim3.tu-clausthal.de (dorifer.heim3.tu-clausthal.de [139.174.243.252]) by hub.freebsd.org (Postfix) with ESMTP id 003F237B64E for ; Fri, 3 Mar 2000 12:31:01 -0800 (PST) (envelope-from olli@dorifer.heim3.tu-clausthal.de) Received: (from olli@localhost) by dorifer.heim3.tu-clausthal.de (8.9.3/8.9.3) id VAA18718; Fri, 3 Mar 2000 21:30:57 +0100 (CET) (envelope-from olli) Date: Fri, 3 Mar 2000 21:30:57 +0100 (CET) Message-Id: <200003032030.VAA18718@dorifer.heim3.tu-clausthal.de> From: Oliver Fromme To: freebsd-current@FreeBSD.ORG Reply-To: freebsd-current@FreeBSD.ORG Subject: Re: which(1), rewritten in C? X-Newsgroups: list.freebsd-current In-Reply-To: <89p5vh$sf$1@atlantis.rz.tu-clausthal.de> User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (FreeBSD/3.4-19991219-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'd like to add my 2 cents, too. I agree that "which" should be a shell-builtin, because it is dependant on how the shell will search and performe a command (it might be an alias, a shell function, or a shell-builtin, or a "normal" program). Personally, I use the zsh, and its "which" builtin has served me very well (zsh also supports "type" according to POSIX). Another useful command is "where", which prints all possible locations of a command, in order of preference (not just the first one like "which" does). Finally, I like the "path expansion" feature very much: an equal sign followed by a command name will expand to the full path of the command. For example, "vi =foo" is an easy way to edit the foo script, no matter where it is and where my cwd is, and "file =bar" tells me if bar is a binary, a shell script, a perl hack or whatever, without having to know where it is. Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de) "In jedem Stück Kohle wartet ein Diamant auf seine Geburt" (Terry Pratchett) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message