Page MenuHomeFreeBSD

D26182.id76206.diff
No OneTemporary

D26182.id76206.diff

Index: usr.bin/which/which.1
===================================================================
--- usr.bin/which/which.1
+++ usr.bin/which/which.1
@@ -62,6 +62,48 @@
Consult the
.Xr builtin 1
manual page.
+.Sh EXAMPLES
+Locate the
+.Xr ls 1
+and
+.Xr cp 1
+commands:
+.Bd -literal -offset indent
+$ /usr/bin/which ls cp
+/bin/ls
+/bin/cp
+.Ed
+.Pp
+Same as above with a specific
+.Va PATH
+and showing all occurrences:
+.Bd -literal -offset indent
+$ PATH=/bin:/rescue /usr/bin/which -a ls cp
+/bin/ls
+/rescue/ls
+/bin/cp
+/rescue/cp
+.Ed
+.Pp
+.Nm which
+will show duplicates if the same executable is find more than once:
+.Bd -literal -offset indent
+$ PATH=/bin:/bin /usr/bin/which -a ls
+/bin/ls
+/bin/ls
+.Ed
+.Pp
+Do not show output.
+Just exit with an appropriate return code:
+.Bd -literal -offset indent
+$ /usr/bin/which -s ls cp
+$ echo $?
+0
+
+$ /usr/bin/which -s fakecommand
+$ echo $?
+1
+.Ed
.Sh SEE ALSO
.Xr builtin 1 ,
.Xr csh 1 ,

File Metadata

Mime Type
text/plain
Expires
Wed, Feb 18, 3:49 PM (9 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28849033
Default Alt Text
D26182.id76206.diff (959 B)

Event Timeline