Your mistake is that perl interpolates $JAVA_HOME before the echo command is executed and I guess $JAVA_HOME in your code isn't defined.
Try $ENV{JAVA_HOME} to get the variable you want.
If you insist (for any reason) to use the echo command's output or need to bypass the perl interpolation, write \$JAVA_HOME.
Enjoy,
Mickey
In reply to Re: taking an output in a variable
by mickeyn
in thread taking an output in a variable
by s_gaurav1091
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |