- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ksh script, unbuffering(?) output
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
тАО02-16-2001 10:48 AM
тАО02-16-2001 10:48 AM
here is the statement I am using: (/opt/omni/sbin/omnidbutil -readascii -mmdb $workdir -cdb $workdir;echo $?>$raerrcd) <
Y
EOF
I echo the return status ($?) to the file $raerrcd inside the subshell so that I can retrieve it and check it later. Outside the subshell I redirect all the output to tee so that output goes to both the display and the file $fileout. In addition there is input required by the program that is provided in the last two lines via the redirection <
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2001 02:24 PM
тАО02-16-2001 02:24 PM
Solution(omnidbutil -readascii -mmdb $workdir -cdb $workdir;echo $?>$raerrcd) <
Regular awk doesn't support fflush().
-sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2001 01:28 AM
тАО02-19-2001 01:28 AM
Re: ksh script, unbuffering(?) output
Not sure if this would work, but if the problem is with the tee, could you wrap your statements in a script command?
This should get all the output to the logfile and, I think, to the display as well. As far as I know there's no buffering.
Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2001 07:14 AM
тАО02-19-2001 07:14 AM
Re: ksh script, unbuffering(?) output
You can control the this jobs with tail -f
(/opt/omni/sbin/omnidbutil -readascii -mmdb $workdir -cdb $workdir;echo $?>$raerrcd) <
tail -f $fileout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-22-2001 10:46 AM
тАО02-22-2001 10:46 AM
Re: ksh script, unbuffering(?) output
I had thought about the tail option but did really like the idea of looping through a tail for 6 hours till the background job completed.
I am intrigued by Marcel's idea, but I am not sure what you mean by wrapping the statements in a script command? These statements are already in a shell script with a few other housekeeping statements. How do I wrap them in a script command?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-23-2001 05:23 AM
тАО02-23-2001 05:23 AM
Re: ksh script, unbuffering(?) output
Sorry, looks like I've caused confusion.
Your running a shell script, but, if before you run it you type:
script logfile.log
and then do a Ctrl-D after your shell script has finished you'll end up with a file called logfile.log which should contain all the output from the shell script.
Of course, rather than typing it at the command line you can bung it in a wrapper for your existing shell script.
Cheers,
Marcel