Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
3
Newest
 Scholar
Impact
~385 people reached

  • 0 posts edited
  • 0 helpful flags
  • 0 votes cast
Jul
20
awarded  Scholar
Jul
20
accepted Strange behavour of which in a shell script launched as a forked process
Jul
18
comment Strange behavour of which in a shell script launched as a forked process
And this whole script is being used to find the unknown JDK home path so we cannot hard-code the path... if we could hard-code it we wouldn't be running this script in the first place!
Jul
18
comment Strange behavour of which in a shell script launched as a forked process
@c4f4t0r I think you mis-understand the issue. When which javac is being run the only thing we know is that javac is on the shell's PATH but due to the way the shell process is invoked, the shell process environment does not have a PATH so which is exiting with 1 as there is no javac on its PATH. By adding export PATH="$PATH" I ensure that the forked which has a PATH and hence can find the same javac as the shell was
Jul
18
answered Strange behavour of which in a shell script launched as a forked process
Jul
18
asked Strange behavour of which in a shell script launched as a forked process
Nov
26
answered Command line tools for ping HTTP?
Nov
26
awarded  Autobiographer
Nov
26
awarded  Teacher