- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Redirection Help
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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-2005 09:38 AM
тАО12-07-2005 09:38 AM
Redirection Help
I am running one program it gives me output on the console ( which has my debugging statement on my code ) Like follow
Trying...
Connected to dhn1b203.dev.cingular.net.
Escape character is '^]'.
Connection closed by foreign host.
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- BatchEnd --->
[07/12/2005 : 14:22.43.976368174] (3): :: Moving File
--- moveComplete --->
[07/12/2005 : 14:22.43.976368174] (3): :: Move script successful
[07/12/2005 : 14:22.43.976368174] (3): :: Parsing file
[07/12/2005 : 14:22.43.976368174] (3): :: Parse script returned, no files to process
I tried to redirect all this into a file. But i could not
I Tried
/home/raj/bin/>execute nor13cw > raj.txt 2>&1
execute nor13cw is my program
But the output file (raj.txt) only has
Trying...
Connected to dhn1b203.dev.cingular.net.
Escape character is '^]'.
Connection closed by foreign host.
The remaining below stuff is not in the raj.txt
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- Event --->
--- BatchEnd --->
I can not redirect the debugging statements on the cosole to a file ? :(
Thanks in advance,
-raj..
- Tags:
- redirect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 09:43 AM
тАО12-07-2005 09:43 AM
Re: Redirection Help
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=981717
Thanks
Sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 09:44 AM
тАО12-07-2005 09:44 AM
Re: Redirection Help
# ./yourscript > logfile 2>&1
Regards!
See the man pages for 'sh-posix'.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 09:55 AM
тАО12-07-2005 09:55 AM
Re: Redirection Help
Sanjay can you please give me the solution rather than telling something. I am new to posting, sorry if reposting matters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 01:02 PM
тАО12-07-2005 01:02 PM
Re: Redirection Help
when you are talking about "console" are referring to the terminal window on your workstation or the actual, physical console of the server ? Because, if it is the server console, the Event lines you see, may be fed by a the syslogd and does not belong to neither the STDOUT nor the STDERR devices, in which case, not being able to capture them by redirection, would not be surprising. Otherwise, i.e., if this is a regular terminal session giving you this trouble, executing the command like James described in his post above, should take care of the problem.
Hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 01:13 PM
тАО12-07-2005 01:13 PM
Re: Redirection Help
I tried james idea i could not figure out the solution yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 01:31 PM
тАО12-07-2005 01:31 PM
Re: Redirection Help
--- Event --->
--- BatchEnd --->
[07/12/2005 : 14:22.43.976368174] (3): :: Moving File
--- moveComplete --->
[07/12/2005 : 14:22.43.976368174] (3): :: Move script successful
[07/12/2005 : 14:22.43.976368174] (3): :: Parsing file
[07/12/2005 : 14:22.43.976368174] (3): :: Parse script returned, no files to process
is not of much help to figure it out.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 02:06 PM
тАО12-07-2005 02:06 PM
Re: Redirection Help
I have a debugging statements in the script. I have debugging stmts just to understand the flow of the system.
You see this below ? Those are all the debug statements in the program.
--Event--->
--- BatchEnd --->
[07/12/2005 : 14:22.43.976368174] (3): :: Moving File
--- moveComplete --->
When i run "execute nor13cw" from the command prompt, it start executing the c & the scripts, started executing my code where i have my debug statements. I want to redirect these into a file so i can see what is the flow of the code etc.,
But i could not able to capture those logs. Its keep running on the terminal. so its hard for me to see what is going on there. Tried to redirect using like "home/raj/bin/>execute nor13cw > raj.txt 2>&1" .. but still i am not ableto capture the logs.
Please let know if you need any information. I am also trying some other things. If i come across the solution i will post
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 02:16 PM
тАО12-07-2005 02:16 PM
Re: Redirection Help
Looks like the scripts which are called from this compiled program are generating the output that you are unable to capture, hence stuff you see are not actually the STDOUT of the nor13cw, hence no chance to capture.
best way I can suggest is to start a screen capture session before you run it and when finished, exit the screen capture session and use typescript file as your log as follows
# script; /home/raj/bin/nor13cw ; exit
your log and some more is in typescript file in the current directory.
Hope this helps (a little)
UNIX because I majored in cryptology...
- Tags:
- Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2005 04:32 PM
тАО12-07-2005 04:32 PM
Re: Redirection Help
# ./yourscript | tee -a test.log 2>>test.log
or
# script
# ./yourscript
# exit
will capture all execution and results of yourscript. Revert if it is not working.
-Muthu