将Shell输出重定向到文件
问题描述:
我正在AIX 6上工作,在AIX 6上我在Korn Shell上运行Java命令,并且试图调试类加载问题.我放了-verbose:class来打印加载的类,然后>>/home/user/log.log来把控制台放到一个文件中.已创建log.log文件,但其大小为零.文件不包含任何信息,所有详细信息都在屏幕上快速掠过.
I am working on AIX 6 where I am running a java command on a Korn Shell and I am trying to debug the class loading issue. I put -verbose:class to print the class loaded and then >>/home/user/log.log to get the console out put in a file. The log.log file is got created but its of zero size. File is not containing any information and all the verbose details are ripping through the screen in a flash.
/usr/IBM/WebSphere/AppServer/java/bin/java -verbose:class -cp "XXXXX" com.ibm.XXXX >>/home/user/log.log
答
还尝试重定向stderr
:
/usr/IBM/WebSphere/AppServer/java/bin/java -verbose:class -cp "XXXXX" com.ibm.XXXX >>/home/user/log.log 2>&1
您的Java代码可能正在stderr
上编写,您的命令未重定向.
Your Java code might be writing on stderr
that your command isn't redirecting.