Redirect java -version to file or variable
问题 Maybe it is a silly question, but I'm trying to redirect the exit of "java -version" command to a file or variable but it doesn't work. Server = Linux CentOS 6 My code in shell script java -version >> test.txt Also I'm trying to assign it to a variable: JAVA_CHECK=`java -version` Even running those command from command-line it still not working. when I say it doesnt work, I mean that the exit of the command is being showed in my screen instead to redirect it to a file or wherever ... 回答1: