HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: java command and grep on output
Operating System - Linux
1828456
Members
3757
Online
109978
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2009 08:22 AM
12-07-2009 08:22 AM
Hello
I'd like to save the result of a java ksh command. This command normally show something likke that:
java.sql.SQLException: ORA-01017: invalid username/password; logon denied
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processErr
....
Example: java -jar test.jar | tee -a /tmp/test.tmp
The full result comes on screen but no lines in the /tmp file.
why ?
I think that it's somewhere a problem with standard output but how to do the trick !
Thanks in advance
Bests Regards
Den
I'd like to save the result of a java ksh command. This command normally show something likke that:
java.sql.SQLException: ORA-01017: invalid username/password; logon denied
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processErr
....
Example: java -jar test.jar | tee -a /tmp/test.tmp
The full result comes on screen but no lines in the /tmp file.
why ?
I think that it's somewhere a problem with standard output but how to do the trick !
Thanks in advance
Bests Regards
Den
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2009 09:12 AM
12-07-2009 09:12 AM
Solution
Perhaps the missing messages are not sent to standard output stream (stdout, file descriptor #1), but to standard error stream (stderr, file descriptor #2).
If you wish to capture both, try a command like:
java -jar test.jar 2>&1 | tee -a /tmp/test.tmp
The "2>&1" merges the standard error stream to the output stream, so that the content of both streams can be received by the pipe.
(Nitpick: "java" is not a ksh command, as it is not specific to ksh in any way, nor built in to it. It's a wholly independent program binary, more specifically a Java bytecode interpreter/JIT compiler. It is most commonly known as JVM = Java Virtual Machine.)
MK
If you wish to capture both, try a command like:
java -jar test.jar 2>&1 | tee -a /tmp/test.tmp
The "2>&1" merges the standard error stream to the output stream, so that the content of both streams can be received by the pipe.
(Nitpick: "java" is not a ksh command, as it is not specific to ksh in any way, nor built in to it. It's a wholly independent program binary, more specifically a Java bytecode interpreter/JIT compiler. It is most commonly known as JVM = Java Virtual Machine.)
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2009 10:32 AM
12-07-2009 10:32 AM
Re: java command and grep on output
Thanks Matti, efficient answer !
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP