Sponsored Content
Full Discussion: Pipeing Individual Echos
Top Forums UNIX for Dummies Questions & Answers Pipeing Individual Echos Post 302398464 by binlib on Wednesday 24th of February 2010 06:18:11 PM
Old 02-24-2010
When running the executable on a terminal without piping/redirecting, the output is line buffered so you see the info by lines. To force the output to be line buffered, either run the command under pty, or preload a share library which calls setbuf/setvbuf. If you have ssh running, do
Code:
ssh -t localhost command args |...

 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple echos and cuts too slow

Hi guys, hopefully this hasn't been asked before - couldn't see the question anywhere. I have a large number of timestamps (hh-mm-ss-millisecond) that I need to find the difference between e.g.: 14-11-07-513 14-11-07-644 Now the script that I have just knocked up is horrifically slow,... (4 Replies)
Discussion started by: dlam
4 Replies

2. Shell Programming and Scripting

Adding the individual columns of a matrix.

I have a huge matrix file containing some 1.5 million rows and 6000 columns. The matrix looks something like this: 1 2 3 4 5 6 7 8 9 3 4 5 I want to add all the numbers in the columns of this matrix and display the result to my stdout. This means that the numbers in the first column are: ... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

3. UNIX for Dummies Questions & Answers

Print individual rows.

Hi all, I have a file im reading with a for loop using: for i in $(cat filename) do etc. done the original file is 3 columns, this method prints it out into 3 rows, and i would like to just assign the first to rows (originally first two columns) to separate variables. What would be... (3 Replies)
Discussion started by: jgrosecl
3 Replies

4. HP-UX

Individual file size limit on HP-UX

I got a question on ulimit on HP-UX. I have a log file that gets more than 2 GB and the application crashes because it can not write to log. I browsed through the forum and found one very similar post on ulimit but that was not concluded. Did some analysis and below is some output. >getconf... (6 Replies)
Discussion started by: asutoshch
6 Replies

5. Shell Programming and Scripting

Unpack individual files from tarball

Say you don't want to unpack the whole thing, just individual files or directories within a .tgz. How to do this? (1 Reply)
Discussion started by: stevensw
1 Replies

6. Solaris

Auditing Individual Files

I have some Solaris 9 systems and I'm interested in using the "fm" audit class to track changes to sensitive files but it's too verbose for it to be auditing to that level for EVERY file, so I was wondering if there were a way of restricting the audit of those events to particular files. I... (0 Replies)
Discussion started by: thmnetwork
0 Replies

7. UNIX for Dummies Questions & Answers

Terminal telnet echos garbage

i am trying to make powerterm not echo back this charactor. ≥ When I press control-C I get it that telnet charactor/garbage echos back. how to turn off? where? what config? is there something in powerterm to switch on/off? I do not see it. Redhats offical statement is: "I... (10 Replies)
Discussion started by: olyanderson
10 Replies

8. Solaris

Individual usernames for the same login account

Hi There is an application installed on a server, that has a unique login account, but many users are using it with the same login name! How can we overcame this by creating individual accounts for the same application login account? (11 Replies)
Discussion started by: fretagi
11 Replies
SETBUF(3)						     Library Functions Manual							 SETBUF(3)

NAME
setbuf, setvbuf - assign buffering to a stream SYNOPSIS
#include <stdio.h> int setbuf(FILE *stream, char *buf) int setvbuf(FILE *stream, char *buf, int type, size_t size) DESCRIPTION
The three types of buffering available are unbuffered, block buffered, and line buffered. When an output stream is unbuffered, information appears on the destination file or terminal as soon as written; when it is block buffered many characters are saved up and written as a block; when it is line buffered characters are saved up until a newline is encountered or input is read from stdin. Fflush (see fclose(3)) may be used to force the block out early. Normally all files are block buffered. A buffer is obtained from malloc(3) upon the first getc or putc(3) on the file. If the standard stream stdout refers to a terminal it is line buffered. The standard stream stderr is always unbuffered. Setbuf is used after a stream has been opened but before it is read or written. The character array buf is used instead of an automati- cally allocated buffer. If buf is the constant pointer NULL, input/output will be completely unbuffered. A manifest constant BUFSIZ tells how big an array is needed: char buf[BUFSIZ]; Setvbuf, an alternate form of setbuf, is used after a stream has been opened but before it is read or written. It has three uses, depend- ing on the value of the type argument: setvbuf(stream, buf, _IOFBF, size) Causes input/output to be fully buffered using the character array buf whose size is determined by the size argument. If buf is the constant pointer NULL, then an automatically allocated buffer will be used. setvbuf(stream, buf, _IOLBF, size) Like above, except that output will be line buffered, i.e. the buffer will be flushed when a newline is written, the buffer is full, or input is requested. setvbuf(stream, buf, _IONBF, size) Causes input/output to be completely unbuffered. Buf and size are ignored. A file can be changed between unbuffered, line buffered, or block buffered by using freopen (see fopen(3)) followed by the appropriate setvbuf call. SEE ALSO
fopen(3), getc(3), putc(3), malloc(3), fclose(3), puts(3), printf(3), fread(3). 4th Berkeley Distribution May 12, 1986 SETBUF(3)
All times are GMT -4. The time now is 01:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy