Write a shell script called whichpath which takes
a match string and looks in your $PATH variable for
paths containing the match string. It prints out each path
which matches.
Hint: use the previous exercise and add another element to the
end of the pipe. In a script $1 is expanded to the first
argument on the command line that ran the script.
Here is an example:
[csc322@lee ~/bin]$ whichpath java
/usr/java/jdk1.5.0/bin
[csc322@lee ~/bin]$ whichpath bin
/usr/kerberos/bin
/usr/local/bin
/bin
/usr/bin
/home/graph/csc322/bin
/usr/java/jdk1.5.0/bin
/usr/X11R6/bin
[csc322@lee ~/bin]$ whichpath Chattahoochee
[csc322@lee ~/bin]$