--- which.1-orig 2007-01-01 12:26:09.000000000 -0500 +++ which.1 2007-01-01 12:29:01.000000000 -0500 @@ -1,26 +1,12 @@ -.TH WHICH 1 -.rn RS Rs -.de RS -.na +.de EX .nf -.Rs +.ft CW .. -.rn RE Re -.de RE -.Re +.de EE +.ft R .fi -.ad -.. -.de Sx -.PP -.ne \\$1 -.RS -.. -.de Ex -.RE -.PP .. -.na +.TH WHICH 1 .SH NAME which \- shows the full path of (shell) commands. .SH SYNOPSIS @@ -45,9 +31,10 @@ Read aliases from stdin, reporting matching ones on stdout. This is useful in combination with using an alias for which itself. For example -.br -.B +.sp +.EX alias which=\'alias | which -i\'\fR. +.EE .TP .B --skip-alias\fR Ignore option \`--read-alias\', if any. This is useful to @@ -58,11 +45,11 @@ Read shell function definitions from stdin, reporting matching ones on stdout. This is useful in combination with using a shell function for which itself. For example: -.br -.B +.sp +.EX which() { declare -f | which --read-functions $@ } -.br export -f which\fR +.EE .TP .B --skip-functions\fR Ignore option \`--read-functions\', if any. This is useful to @@ -105,42 +92,36 @@ [ba]sh: -.in +5 -.nf -.na +.RS +.EX which () { (alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@ } export -f which -.in -5 -.ad -.fi +.EE +.RS [t]csh: -.in +5 -.nf -.na +.RS +.EX alias which \'alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde\' -.in -5 -.ad -.fi +.EE +.RE This will print the readable ~/ and ./ when starting which from your prompt, while still printing the full path when used from a script: -.in +5 -.nf -.na +.RS +.EX > which q2 ~/bin/q2 > echo \`which q2\` /home/carlo/bin/q2 -.in -5 -.ad -.fi +.EE +.RE .SH BUGS The \fBHOME\fR directory is determined by looking for the \fBHOME\fR @@ -149,7 +130,6 @@ to be different when one of them contains a path with a symbolic link. .SH AUTHOR -.br Carlo Wood .SH "SEE ALSO" \fBbash(1)\fR