06-27-2005
Standard output and redirection
Hello,
Is is possible to redirect stdout to a file as well as to the console/screen or display in ksh.
any thoughts suggestions/input is appreciated. Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
while running a user inter-active program
how can we get the commands from a
file instead of the user?
is there anyway to permanently redirect content
of a file to standard input? (6 Replies)
Discussion started by: gfhgfnhhn
6 Replies
2. Shell Programming and Scripting
Hi, trying to store a comand involving a redirection in a variable and then run this variable. But the redirection gets lost.
Ex:
#!ksh
MYCMD="ls -l > dirlist.txt"
$MYCMD
This runs the command but displays the result in the terminal instead of redirecting it to the text file.
Can... (4 Replies)
Discussion started by: rm-r
4 Replies
3. Shell Programming and Scripting
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
4. UNIX for Dummies Questions & Answers
Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway?
Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies
5. Shell Programming and Scripting
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
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
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
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
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. Red Hat
I ran the following command.
cat abc.c > abc.c
I got message the following message from command cat:
cat: abc.c : input file is same as the output file
How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies
LEARN ABOUT MOJAVE
dmxaddinput
DMXAddInput(3) Library Functions Manual DMXAddInput(3)
NAME
DMXAddInput, DMXAddBackendInput, DMXAddConsoleInput - attach a new input
SYNOPSIS
#include <X11/extensions/dmxext.h>
Bool DMXAddInput(Display *dpy,
unsigned int mask,
DMXInputAttributes *attr,
int *id);
Bool DMXAddBackendInput(Display *dpy,
int screen,
int sendsCore,
int *newId);
Bool DMXAddConsoleInput(Display *dpy,
const char *name,
int sendsCore,
int *newId);
DESCRIPTION
DMXAddInput() is used to attach a new input (or a previously detached input) to the Xdmx(1) server. mask specifies the fields in attr that
are active, and id returns the device if of the first device in the series that is added.
The value of mask is computed from the following values:
DMXInputType
DMXInputPhysicalScreen
DMXInputSendsCore
The DMXInputAttributes structure is:
typedef struct {
DMXInputEnum inputType;
int physicalScreen;
int physicalId;
Bool isCore;
Bool sendsCore;
const char *name;
Bool detached;
} DMXInputAttributes;
inputType may have the value DMXConsoleInputType or DMXBackendInputType .
For console devices, name will specify the display to be used.
For back-end devices, physicalScreen will specify the Xdmx(1) screen number.
If sendsCore is True, the new device will be added as a true core device.
If a device was removed with DMXRemoveInput(3) an attempt will be made to reconnect the previous devices (sendsCore is ignored in this
case).
DMXAddBackendInput() is a helper function that is used to add input from a back-end server. With this function, screen refers to the back-
end screen, sendsCore is True if the new input should send core events (and it ignored if the input has been detached), and newId will hold
the device id of the first device in the series added.
DMXAddConsoleInput() is a helper function that is used to add input from a console. With this function, name is the name of the console
display, sendsCore is True if the new input should send core events (and it ignored if the input has been detached), and newId will hold
the device id of the first device in the series added.
RETURN VALUE
DMXAddInput() returns True on success and False otherwise.
DMXAddInput() can generate BadValue (if inputType is invalid or physicalScreen is out of range), BadAccess (if the input has already been
attached or if the backend screen is currently detached).
NOTES
Local devices cannot be attached or detached.
Attributes that are not specified will default to 0. This may lead to unintended results.
SEE ALSO
DMXRemoveInput(3), DMX(3), Xdmx(1)
X Version 11 libdmx 1.1.2 DMXAddInput(3)