Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] bash output buffering



On Wed, Jun 13, 2012 at 7:06 AM, Edward Ned Harvey <blu at nedharvey.com> wrote:
>> From: discuss-bounces+blu=nedharvey.com at blu.org [mailto:discuss-
>> bounces+blu=nedharvey.com at blu.org] On Behalf Of Jack Coats
>>
>> In old SunOS days, we could issue the 'sync' command, twice, to ensure
>> all system
>
> Oh - That would be the command to flush memory to disk. ?I'm talking about a
> level above that.
>
> A command inside of bash generates output every second (ping) redirected to
> a file.
> If you run the command on an interactive shell, then you can tail -f the
> file, and see the output "live" as it happens.
> But if you run the command inside an "at" script, or a cron script, you tail
> -f the file... ?And nothing appears for a few minutes, and then it all
> appears suddenly.

Can you be more specific about what you exact commands you are using?
 When I put the following into a file called foo:

===

#!/bin/sh

ping 127.0.0.1 > $HOME/xxx

===

and then run

"at -f foo now"

The "tail -f $HOME/xxx" does exactly what you want (one line every second).

Bill Bogstad



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org