Sponsored Content
Full Discussion: Output redirection
Top Forums Shell Programming and Scripting Output redirection Post 302489129 by jolateh on Wednesday 19th of January 2011 02:11:19 PM
Old 01-19-2011
Works =]
Thank you very much !

It worked with
Code:
queryCommand [parameters] >file.txt 2>&1

Just to know... what is the 2>&1 for ?

Edit: nvm i looked it up, so i guess the application is throwing the registries on the standard error stream (kinda odd) and you merged them both with the 2>&1. Thanks again.

Last edited by jolateh; 01-19-2011 at 03:29 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Redirection of output (for logging)

Hi, Currently I'm working on a lenghty script so I figured it would be useful to create a logfile so that output that is displayed on the users screen is also stored in the log file for later reference...... kinda like the whole point of a log file! Anyway, I was just wondering if there was an... (3 Replies)
Discussion started by: _Spare_Ribs_
3 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

output and error redirection

hi :) if condition >&- 2>&- Can anybody explain the redirection in above command Thanks in advance (1 Reply)
Discussion started by: jpriyank
1 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. 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

7. Shell Programming and Scripting

Issue with output redirection

Hi, I am using AIX server. I have a korn shell script where in I am redirecting a line to a file in a while loop: while read line do outputline=$line; echo $outputline >> "./temp/exec_list_"$ETL_JOB_RUN"_temp" done < ./temp/exec_list_$ETL_JOB_RUN Sometimes, when the CPU... (2 Replies)
Discussion started by: pmonika
2 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

For loop output redirection

Hi All, i have below for loop of which i am trying to redirect output in a file: for i in `/usr/sbin/ifconfig -a | awk '/flags/ {print $1}' | grep -v lo | sed 's/://g'` do ifconfig $i dhcp status done >> /tmp/logfile but instead the output is appearing as stdout on screen rather than... (12 Replies)
Discussion started by: omkar.jadhav
12 Replies
nns_intro(n)						       Name service facility						      nns_intro(n)

__________________________________________________________________________________________________________________________________________________

NAME
nns_intro - Name service facility, introduction DESCRIPTION
nns (short for nano nameservice) is a facility built for the package comm, adding a simple name service to it. It is also built on top of comm, using it for the exchange of messages between the client and server parts. This name service facility has nothing to do with the Internet's Domain Name System, otherwise known as DNS. If the reader is looking for a package dealing with that please see either of the packages dns and resolv, both found in Tcllib too. Tcllib provides 2 applications and 4 packages which are working together and provide access to the facility at different levels. APPLICATIONS
The application nnsd provides a simple name server which can be run by anybody anywhere on their system, as they see fit. It is also an example on the use of the server-side package nameserv::server. Complementing this server is the nns client application. A possible, but no very sensible use would be to enter name/port bindings into a server from a shell script. Not sensible, as shell scripts normally do not provide a comm-based service. The only case for this to make some sense would be in a shell script wrapped around a Tcl script FOO which is using comm, to register the listening port used by FOO. However even there it would much more sensible to extend FOO to use the nameservice directly. And in regard on how to that nns can be used as both example and template. Beyond that it may also be useful to perform nameservice queries from shell scripts. The third application, nnslog is a stripped down form of the nns client application. It is reduced to perform a continuous search for all changes and logs all received events to stdout. Both clients use the nameserv::auto package to automatically hande the loss and restoration of the connection to the server. PACKAGES
The two main packages implementing the service are nameserv and nameserv::server, i.e. client and server. The latter has not much of an API, just enough to start, stop, and configure it. See the application nnsd on how to use it. The basic client, in package nameserv, provides the main API to manipulate and query the service. An example of its use is the application nns. The second client package, nameserv::auto is API compatible to the basic client, but provides the additional functionality that it will automatically restore data like bound names when the connection to the name service was lost and then reestablished. I.e. it automatically detects the loss of the server and re-enters the data when the server comes back. The package nameserv::common is of no interest to users. It is an internal package containing code and definitions common to the packages nameserv and nameserv::server. All packages use the uevent package for the reporting of special circumstances via events, and reserve the uevent-tag nameserv for their exclusive use. All their events will be posted to that tag. INTERNALS
The document Name service facility, client/server protocol specifies the protocol used by the packages nameserv and nameserv::server to talk to each other. It is of no interest to users of either the packages or applications. Developers wishing to modify and/or extend or to just understand the internals of the nameservice facility however are strongly advised to read it. BUGS, IDEAS, FEEDBACK This document, will undoubtedly contain bugs and other problems. Please report such in the category nameserv of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. Please also report any ideas for enhancements you may have. SEE ALSO
nameserv(n), nameserv::auto(n), nameserv::common(n), nameserv::protocol(n), nameserv::server(n), nnsd(n), nss(n) KEYWORDS
client, name service, server COPYRIGHT
Copyright (c) 2008 Andreas Kupries <andreas_kupries@users.sourceforge.net> nns 1.0 nns_intro(n)
All times are GMT -4. The time now is 05:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy