chris clarke
software development that works…or something
GNUs Not U 4
March 5, 2007 on 10:44 pm | In Unix |Here’s a puzzler. Minimize the following command which looks for multiple entries of a command in the PATH environment variable:
echo $PATH | awk 'BEGIN { RS=":" } ; { print; }' | xargs -I{} find {} -name ant
You could use which:
which ant
But that will only return one answer.
Could use locate:
locate ant
But that will return things not in the PATH.
Could use whereis:
whereis ant
But that only looks in a list of standard linux places, the PATH may be unconventional.
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
GNUs Not U 4
March 5, 2007 on 10:44 pm | In Unix |Here’s a puzzler. Minimize the following command which looks for multiple entries of a command in the PATH environment variable:
echo $PATH | awk 'BEGIN { RS=":" } ; { print; }' | xargs -I{} find {} -name ant
You could use which:
which ant
But that will only return one answer.
Could use locate:
locate ant
But that will return things not in the PATH.
Could use whereis:
whereis ant
But that only looks in a list of standard linux places, the PATH may be unconventional.
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by Cheese.
RSS Entries Feed.
RSS Comments Feed
^Top^