Sponsored Content
Full Discussion: output and error redirection
Top Forums Shell Programming and Scripting output and error redirection Post 302344983 by vidyadhar85 on Tuesday 18th of August 2009 06:37:46 AM
Old 08-18-2009
here the code is invoked with standard output and standard error closed..
basically here they are closing the output file descriptor..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

redirection of ladebug output

i am using a command line ladebug debugger. i want to redirect the responses of the debugger to a text file but run args > output-file syntax does not successful because it redirects only the standard out of the binary that i am examining, but i want the debuggers own responses like "stopped... (2 Replies)
Discussion started by: yakari
2 Replies

2. UNIX for Dummies Questions & Answers

output redirection in scripts

I am trying to write a script that will remove any line in 2 given text files starting with '-'. the output should be to the second file. this is what I tried: #!/bin/csh -f cat $1 $2 | grep -v '^-' > $2 the problem is the after executing the script, file2 contains only the lines from... (7 Replies)
Discussion started by: stewie griffin
7 Replies

3. Shell Programming and Scripting

redirection output in two files

I want to redirect output of my script to two logfiles. I tried this : ./run.sh -c APP | tee >(grep " " > AppLogs.log) >(grep "XYZ" > xyz.log) >dev/null but this does not solve my purpose because logfile xyz.log remains empty untill i stop my script, i want both files, AppLogs.log and... (4 Replies)
Discussion started by: cmdup
4 Replies

4. Shell Programming and Scripting

redirection and output

I'm redirecting the output of a command to a logfile, however, if the user is on a terminal I would also like the output to be displayed on the screen. tar tvf some_tarfile >Logfile if the user is on a term then have the output to the Logfile and also be displayed on the screen at the same... (2 Replies)
Discussion started by: nck
2 Replies

5. Shell Programming and Scripting

Redirection output

Hi there I have a script that runs but it outputs everything onto the screen instead of a file. I've tried using the > outputfile.txt however all it does is dump the output to the screen and creates an outputfile.txt but doesn't put anything in that file. Any help would be appreciated ... (6 Replies)
Discussion started by: kma07
6 Replies

6. Shell Programming and Scripting

Output redirection

We have an application here that does some table queries and then prints the result on screen. I do not have the code of this application (which i will just call "queryCommand"), but what it does is that you call it with some parameters and it prints some info about the query and then the... (5 Replies)
Discussion started by: jolateh
5 Replies

7. UNIX for Dummies Questions & Answers

Output redirection

Hello i am trying to write a script that will redirect the output to a certain file. Here is the code so far: #!/bin/bash ps -e | sort | more > psfile When I execute the script nothing happens since i assume the output was redirected to the file called psfile. When I try to look at the... (1 Reply)
Discussion started by: mfruiz34
1 Replies

8. Shell Programming and Scripting

Redirection of ls -l output

Hi I am making a script where i want to redirect the output of ls -l to a file Example #ls -l fil1.txt > /opt/temp/a.txt ac: No such file or directory I want to capture output of this command like here output is ac: No such file or directory can anyone help (4 Replies)
Discussion started by: anish19
4 Replies

9. Shell Programming and Scripting

output redirection

Hi all I was wondering if there was a slicker way of doing this without the file - awk '{print $2}' FS=":" "${FILE}" > "${TMPFILE}" { read M_GRP_ID || m_fail 1 "Error: Read failed 1 (${FUNCNAME})" read M_GRP_WAIT || m_fail 1 "Error: Read failed 2 (${FUNCNAME})" }... (6 Replies)
Discussion started by: steadyonabix
6 Replies

10. Shell Programming and Scripting

Conditional output redirection

Hi there, I'm in a coding mood! I've come through many ways of conditionally redirect the output of a script like: ] || exec &> /dev/nullBut my goal is slightly different. I would like to conditionally redirect the output of a command depending on the status of the command itself: if !... (6 Replies)
Discussion started by: chebarbudo
6 Replies
Tcl_GetStdChannel(3)					      Tcl Library Procedures					      Tcl_GetStdChannel(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_GetStdChannel, Tcl_SetStdChannel - procedures for retrieving and replacing the standard channels SYNOPSIS
#include <tcl.h> Tcl_Channel Tcl_GetStdChannel(type) Tcl_SetStdChannel(channel, type) ARGUMENTS
int type (in) The identifier for the standard channel to retrieve or modify. Must be one of TCL_STDIN, TCL_STDOUT, or TCL_STDERR. Tcl_Channel channel (in) The channel to use as the new value for the specified standard channel. _________________________________________________________________ DESCRIPTION
Tcl defines three special channels that are used by various I/O related commands if no other channels are specified. The standard input channel has a channel name of stdin and is used by read and gets. The standard output channel is named stdout and is used by puts. The standard error channel is named stderr and is used for reporting errors. In addition, the standard channels are inherited by any child processes created using exec or open in the absence of any other redirections. The standard channels are actually aliases for other normal channels. The current channel associated with a standard channel can be retrieved by calling Tcl_GetStdChannel with one of TCL_STDIN, TCL_STDOUT, or TCL_STDERR as the type. The return value will be a valid channel, or NULL. A new channel can be set for the standard channel specified by type by calling Tcl_SetStdChannel with a new channel or NULL in the channel argument. If the specified channel is closed by a later call to Tcl_Close, then the corresponding standard channel will automatically be set to NULL. If a non-NULL value for channel is passed to Tcl_SetStdChannel, then that same value should be passed to Tcl_RegisterChannel, like so: Tcl_RegisterChannel(NULL, channel); This is a workaround for a misfeature in Tcl_SetStdChannel that it fails to do some reference counting housekeeping. This misfeature can- not be corrected without contradicting the assumptions of some existing code that calls Tcl_SetStdChannel. If Tcl_GetStdChannel is called before Tcl_SetStdChannel, Tcl will construct a new channel to wrap the appropriate platform-specific stan- dard file handle. If Tcl_SetStdChannel is called before Tcl_GetStdChannel, then the default channel will not be created. If one of the standard channels is set to NULL, either by calling Tcl_SetStdChannel with a NULL channel argument, or by calling Tcl_Close on the channel, then the next call to Tcl_CreateChannel will automatically set the standard channel with the newly created channel. If more than one standard channel is NULL, then the standard channels will be assigned starting with standard input, followed by standard out- put, with standard error being last. See Tcl_StandardChannels for a general treatise about standard channels and the behaviour of the Tcl library with regard to them. SEE ALSO
Tcl_Close(3), Tcl_CreateChannel(3), Tcl_Main(3), tclsh(1) KEYWORDS
standard channel, standard input, standard output, standard error Tcl 7.5 Tcl_GetStdChannel(3)
All times are GMT -4. The time now is 03:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy