Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin Remove which (the csh script installed in /usr/bin).
details: https://anonhg.NetBSD.org/src/rev/1a054f0a85ea
branches: trunk
changeset: 565201:1a054f0a85ea
user: martin <martin%NetBSD.org@localhost>
date: Thu Apr 01 14:41:53 2004 +0000
description:
Remove which (the csh script installed in /usr/bin).
It was docuemented to work for *csh users only, and all *csh have a builtin
of that name, which works even better. All other shells have similar
builtins, and this led to confusion several times. Fixes PR 13462.
diffstat:
usr.bin/Makefile | 4 +-
usr.bin/which/Makefile | 7 ----
usr.bin/which/which.1 | 83 -------------------------------------------------
usr.bin/which/which.csh | 81 -----------------------------------------------
4 files changed, 2 insertions(+), 173 deletions(-)
diffs (201 lines):
diff -r 0e10504a34ad -r 1a054f0a85ea usr.bin/Makefile
--- a/usr.bin/Makefile Thu Apr 01 14:41:09 2004 +0000
+++ b/usr.bin/Makefile Thu Apr 01 14:41:53 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.138 2004/03/26 08:52:26 mrg Exp $
+# $NetBSD: Makefile,v 1.139 2004/04/01 14:41:53 martin Exp $
# from: @(#)Makefile 8.3 (Berkeley) 1/7/94
.include <bsd.own.mk>
@@ -25,7 +25,7 @@
tr true tset tsort tty ul uname unexpand unifdef \
uniq units unvis usbhidaction usbhidctl users \
uudecode uuencode vacation vgrind vi vis vmstat w \
- wall wc what whatis whereis which who whois window \
+ wall wc what whatis whereis who whois window \
write xargs xinstall xlint xstr yacc yes
.if (${MKHESIOD} != "no")
diff -r 0e10504a34ad -r 1a054f0a85ea usr.bin/which/Makefile
--- a/usr.bin/which/Makefile Thu Apr 01 14:41:09 2004 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-# $NetBSD: Makefile,v 1.6 1997/03/24 22:00:03 christos Exp $
-# from: @(#)Makefile 5.5 (Berkeley) 7/1/90
-
-MAN= which.1
-SCRIPTS=which.csh
-
-.include <bsd.prog.mk>
diff -r 0e10504a34ad -r 1a054f0a85ea usr.bin/which/which.1
--- a/usr.bin/which/which.1 Thu Apr 01 14:41:09 2004 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-.\" $NetBSD: which.1,v 1.9 2003/08/07 11:17:18 agc Exp $
-.\"
-.\" Copyright (c) 1980, 1991 Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" from: @(#)which.1 6.3 (Berkeley) 4/23/91
-.\" $NetBSD: which.1,v 1.9 2003/08/07 11:17:18 agc Exp $
-.\"
-.Dd April 23, 1991
-.Dt WHICH 1
-.Os
-.Sh NAME
-.Nm which
-.Nd "locate a program file including aliases and paths"
-.Po
-.Xr csh 1
-only
-.Pc
-.Sh SYNOPSIS
-.Nm
-.Op Fl a
-.Ar name
-.Op Ar ...
-.Sh DESCRIPTION
-.Nm
-takes a list of names and looks for the files which would be
-executed had these names been given as commands.
-Each argument is expanded if it is aliased,
-and searched for along the user's
-.Ev PATH .
-Both aliases and path are taken from the user's
-.Pa \&.cshrc
-file.
-.Pp
-If the
-.Fl a
-flag is given,
-.Nm
-will continue to search the
-.Ev PATH
-until all instances of a program file are found.
-.Sh FILES
-.Bl -tag -width ~/\&.cshrc
-.It Pa ~/\&.cshrc
-source of aliases and path values
-.El
-.Sh DIAGNOSTICS
-A diagnostic is given for names which are aliased to more than a single
-word,
-or if an executable file with the argument name was not found in the path.
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Bx 3.0 .
-.Sh BUGS
-Must be executed by a
-.Xr csh 1 ,
-or some other shell which knows about aliases.
diff -r 0e10504a34ad -r 1a054f0a85ea usr.bin/which/which.csh
--- a/usr.bin/which/which.csh Thu Apr 01 14:41:09 2004 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#!/bin/csh
-# $NetBSD: which.csh,v 1.3 1999/03/11 11:15:44 fair Exp $
-#
-# DO NOT USE "csh -f"
-#
-# Copyright (c) 1983 The Regents of the University of California.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# @(#)which.csh 5.5 (Berkeley) 4/18/91
-#
-
-# which : tells you which program you get
-#
-set prompt = "% "
-set noglob
-unset keepgoing
-if ( $1 == "-a" ) then
- set keepgoing=1
- shift
-endif
-foreach arg ( $argv )
- set alius = `alias $arg`
- switch ( $#alius )
- case 0 :
- breaksw
- case 1 :
- set arg = $alius[1]
- breaksw
- default :
- echo ${arg}: " " aliased to $alius
- continue
- endsw
- unset found
- if ( $arg:h != $arg:t ) then
- if ( -e $arg ) then
- echo $arg
- else
- echo $arg not found
- endif
- continue
- else
- foreach i ( $path )
- if ( -x $i/$arg && ! -d $i/$arg ) then
- echo $i/$arg
- set found
- if ( ! $?keepgoing ) break
- endif
- end
- endif
- if ( ! $?found ) then
- echo no $arg in $path
- endif
-end
Home |
Main Index |
Thread Index |
Old Index