HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Ouput buffering when not a terminal
Operating System - HP-UX
1837981
Members
1866
Online
110124
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
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
06-29-2001 07:31 AM
06-29-2001 07:31 AM
Ouput buffering when not a terminal
I am using GNUs tail (multiple file capability) to have one consolidated log file. This is run from cron:
tail -q -f file* | egrep "warning|error" > error.log
Becuse of the way the stdio libraries work if the output device is a terminal you get no buffering, if not you get full buffering (for my system this is 8192 chars). This leads to delays in me recieving errors.
Does anyone know how I can either fool the cron job into thinking it is a terminal (preferably using hp-ux not something like expect) or any other way I can solve this.
Thanks,
Brenton
tail -q -f file* | egrep "warning|error" > error.log
Becuse of the way the stdio libraries work if the output device is a terminal you get no buffering, if not you get full buffering (for my system this is 8192 chars). This leads to delays in me recieving errors.
Does anyone know how I can either fool the cron job into thinking it is a terminal (preferably using hp-ux not something like expect) or any other way I can solve this.
Thanks,
Brenton
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2001 08:04 AM
06-29-2001 08:04 AM
Re: Ouput buffering when not a terminal
Hi,
did you try to write to a pipe first, and then read from the pipe with a dd and a smaller block-size ?
mknod pipe p
ls -l > pipe ; dd if=pipe of=error.log bs=1
Another idea is, if your gnu-tail is multiple capable, to fool him with a dummy error from a seperate stream, to force linefeeds, and eliminate the dummys later.
No idea if this works
Volker
did you try to write to a pipe first, and then read from the pipe with a dd and a smaller block-size ?
mknod pipe p
ls -l > pipe ; dd if=pipe of=error.log bs=1
Another idea is, if your gnu-tail is multiple capable, to fool him with a dummy error from a seperate stream, to force linefeeds, and eliminate the dummys later.
No idea if this works
Volker
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP