First off I'm not sure what you're trying to do here but to reinforce what has already been stated by spirtle the code needs to be rectified.
There's no need to cast the int read from standard input to char so the char c; c = (char) in; and c = NULL; statements are unneccessary as this one suffices.
The terminal condition for the while loop should check for EOF instead of NULL
and fputc() writes to stdout NOT stdin
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,
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)
Hi,
i am using the below program to read from the standard input or to write to standard out put.
i know that using highlevel functions this can be done better than what i have done here.
i just want to know is there any other method by which i find the exact number of characters ( this... (3 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
tai64nlocal
tai64nlocal(8) System Manager's Manual tai64nlocal(8)NAME
tai64nlocal - converts precise TAI64N timestamps to a human-readable format.
SYNOPSIS
tai64nlocal
DESCRIPTION
tai64nlocal reads lines from stdin. If a line does not begin with @, tai64nlocal writes it to stdout without change. If a line begins with
@, tai64nlocal looks for a timestamp after the @, in the format printed by tai64n(8), and writes the line to stdout with the timestamp con-
verted to local time in ISO format: YYYY-MM-DD HH:MM:SS.SSSSSSSSS.
For example, in the US/Pacific time zone, the input line
@4000000037c219bf2ef02e94 mark
should be printed as
1999-08-23 21:03:43.787492500 mark
Beware, however, that the current implementation of tai64nlocal relies on the UNIX localtime library routine to find the local time. Some
localtime implementations use a broken time scale that does not account for leap seconds. On systems that use the Olson tz library (with an
up-to-date leap-second table), you can fix this problem by setting your time zone to, e.g, right/US/Pacific instead of US/Pacific.
Beware also that most localtime implementations are not Y2038-compliant.
tai64nlocal does not allocate any memory after it starts, except possibly inside localtime.
EXIT CODES
tai64nlocal exits 0 when it sees end of input. It exits 111 without an error message if it has trouble reading stdin or writing stdout.
SEE ALSO supervise(8), svc(8), svok(8), svstat(8), svscanboot(8), svscan(8), readproctitle(8), fghack(8), pgrphack(8), multilog(8), tai64n(8), setu-
idgid(8), envuidgid(8), envdir(8), softlimit(8), setlock(8)
http://cr.yp.to/daemontools.html
tai64nlocal(8)