On a unix machine, how can I write a shell script for checking if 'java bin' directory has been included in $PATH env. variable?
-
1You've asked 6 questions on the site, haven't accepted any answers, and only done 4 upvotes. Learn how to use the site or people will stop answering your questions.Paul Tomblin– Paul Tomblin2010-06-23 14:36:49 +00:00Commented Jun 23, 2010 at 14:36
-
Thanks for the comment. I will be doing this from now on.Abhishek– Abhishek2010-06-24 06:10:51 +00:00Commented Jun 24, 2010 at 6:10
Add a comment
|
4 Answers
It's probably simplest to use which:
which java || exit 1
3 Comments
Michael Mrozek
@Paul I see 14:13:59Z for both
Paul Tomblin
Yeah, but yours shows up ahead of mine, so you must have hit the database ahead of mine.
Michael Mrozek
@Paul Ah, I guess checking the ID would be the logical way to find out :)