-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
formatted output cannot be piped #28
Comments
I believe this has already been fixed. Curses used to be initialized for formatted output but this is no longer the case. What you describe works for me. |
I have version 3.6 on OS X, installed with homebrew. I'll try building from source. |
Still doesn't work with a fresh clone. Any idea why? yohai@imac-5k ~/code/software/bmon$ bmon -o format
lo0 44484079 44484079 629458 629458
en0 248662754 38887010 296994 251607
en1 0 0 0 0
en2 0 0 0 0
en3 0 0 0 0
bridge0 0 342 0 1
^C
yohai@imac-5k ~/code/software/bmon$ bmon -o format > foo.txt
^C
yohai@imac-5k ~/code/software/bmon$ ls -lrt
total 984
drwxr-xr-x 3 yohai staff 102 30 jui 12:05 m4
-rw-r--r-- 1 yohai staff 5402 30 jui 12:05 configure.ac
-rwxr-xr-x 1 yohai staff 52 30 jui 12:05 autogen.sh
-rw-r--r-- 1 yohai staff 1587 30 jui 12:05 README.md
-rw-r--r-- 1 yohai staff 619 30 jui 12:05 NEWS
-rw-r--r-- 1 yohai staff 143 30 jui 12:05 Makefile.am
-rw-r--r-- 1 yohai staff 1023 30 jui 12:05 LICENSE.MIT
-rw-r--r-- 1 yohai staff 1192 30 jui 12:05 LICENSE.BSD
-rw-r--r-- 1 yohai staff 0 30 jui 12:05 ChangeLog
-rwxr-xr-x 1 yohai staff 262681 30 jui 12:05 configure
-rw-r--r-- 1 yohai staff 49976 30 jui 12:05 aclocal.m4
drwxr-xr-x 8 yohai staff 272 30 jui 12:05 build-aux
-rw-r--r-- 1 yohai staff 25532 30 jui 12:05 Makefile.in
drwxr-xr-x 6 yohai staff 204 30 jui 12:05 man
drwxr-xr-x 6 yohai staff 204 30 jui 12:05 include
drwxr-xr-x 6 yohai staff 204 30 jui 12:05 examples
-rwxr-xr-x 1 yohai staff 35180 30 jui 12:05 config.status
-rw-r--r-- 1 yohai staff 55532 30 jui 12:05 config.log
-rw-r--r-- 1 yohai staff 25779 30 jui 12:05 Makefile
drwxr-xr-x 52 yohai staff 1768 30 jui 12:05 src
-rw-r--r-- 1 yohai staff 0 30 jui 12:07 foo.txt
yohai@imac-5k ~/code/software/bmon$ I'm running OS X 10.10.2 (Yosemite). |
This seems to be OS X specific then. Works fine on Linux:
Can you try the following? |
|
This may be related to OS X buffering stdout which delays writing to stdout immediately. You may have to use unbuffer or stdbuf if you want to use stdout. Just a guess though. |
The problem was indeed caused by buffering - |
bmon -o format > file.txt
creates an empty file. It is not possible to pipe the output of the program to a file (because of curses, I presume); I ran into this when trying to read the output ofbmon
from a parent process.The text was updated successfully, but these errors were encountered: