The read() call is not going to terminate the input and make it a string.
You could do it like this:
That might work. Or you might have problems with input buffering, and instead of reading strings your program reads one character at a time, with each keypress getting read as you hit the key.
Hi,
Program A: uses pipe()
I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:
* child
-> dup2(fd, STDOUT_FILENO);
-> execl("/path/PROGRAM B", "PROGRAM B", NULL);
* parent
-> char line;
-> read(fd, line, 100);
Question:... (2 Replies)
Hi everyone, first post here.
Anyone who isn't interested in the background, press pagedown :).
I sometimes need to make scripts for little things I need in the infrastructure at the company I work at. Currently I am trying to make a wrapper script for a proprietary image-deployment program.... (2 Replies)
Hi all
I've run into a snag in a program of mine where part of what I entered in at the start of run-time, instead of the current value within printf() is being printed out.
After failing with fflush() and setbuf(), I tried the following approach
void BufferFlusher()
{
int in=0;... (9 Replies)
Hi,
i know how to
a) redirect stdout and stderr to one file,
b) and write to two files concurrently with same output using tee command
Now, i want to do both the above together.
I have a script and it should write both stdout and stderr in one file and also write the same content to... (8 Replies)
Hi,
I am working on a project where I have to generate and execute nasm code on-the-fly. I generate the code in a file program.asm and then execute it.This output is to stdout which i redirect to an output file which i read back to compare results:
system("nasm -f elf program.asm >... (5 Replies)
All,
Ok...so I know I *should* be able to control a process's stdin and stdout from the parent by creating pipes and then dup'ing them in the child. And, this works with all "normal" programs that I've tried. Unfortunately, I want to intercept the stdin/out of the scp application and it seems... (9 Replies)
I want to differentiate the STDOUT and STDERR messages in my terminal .
If a script or command is printing a message in terminal I want to differentiate by colors,
Is it possible ?
Example:
$date
Wed Jul 27 12:36:50 IST 2011
$datee
bash: datee: command not found
$alias ls
alias... (2 Replies)
Well.. let's say i need to write a pretty simple script.
In my script i have 2 variables which can have value of 0 or 1.
$VERBOSE
$LOG
I need to implement these cases:
($VERBOSE = 0 && $LOG = 0) => ONLY ERROR output (STDERR to console && STDOUT to /dev/null)
($VERBOSE = 1... (5 Replies)
Discussion started by: Marmz
5 Replies
LEARN ABOUT DEBIAN
dpipe
DPIPE(1) General Commands Manual DPIPE(1)NAME
dpipe - bi-directional pipe command
SYNOPSIS
dpipe [ command [ args ] ] = [ command [ args ] ]
dpipe [ command [ args ] ] = [ command [ args ] ] [ = [ command [ args ] ] ] ...
DESCRIPTION
dpipe is a general tool to run two commands diverting the standard output of the first command into the standard input of the second and
vice-versa. It is the bi-directional extension of the | (pipe) syntax used by all the shells. The = has been chosen as a metaphor of two
parallel communication lines between the commands. It is also possible to concatenate several tools. Intermediate programs communicate
using standard input and standard output with the preceding tool and alternate standard input and output (respectively file descriptors
number 3 and 4) towards the following tool. If an intermediate tool should process only the data flowing in one direction use { or } as
suffix for the preceding = and prefix of the following one.
This tool has been written as a tool for the Virtual Distributed Ethernet.
EXAMPLE
dpipe a = b
processes a and b are bidirectionally connected: stdin of a is connected to stdout of b and vice-versa
dpipe a = b = c
a and b are connected as above. Alternate stdin of b is connected to stdout of c and alternate stdout of b to stdin of c
dpipe a =} b }= c
This is a cycle of pipes: stdout of a is connected to stdin of b, stdout of b with stdin of c, and stdout of c to stdin of a
dpipe a =} b }={ c {= d = e
all the notations can be mixed together. this is a -> b -> d -> c and back to a; alternate ports of d are connected to e
OPTIONS
no options.
NOTICE
Virtual Distributed Ethernet is not related in any way with www.vde.com ("Verband der Elektrotechnik, Elektronik und Informationstechnik"
i.e. the German "Association for Electrical, Electronic & Information Technologies").
SEE ALSO vde_switch(1), vde_plug(1), vde_plug2tap(1), vdeq(1). wirefilter(1).
AUTHOR
VDE is a project by Renzo Davoli <renzo@cs.unibo.it>.
Virtual Distributed Ethernet December 6, 2006 DPIPE(1)