Hi,
Consider the output of the following commands:
case1)
-------
# ifconfig -a | grep "UP" | grep uplink0:1
# echo $?
Output is: 0
case2
------
# ifconfig -a | grep "UP" | grep uplink0:1; echo $?
Output is: 1
In case2 we got the exit code as 1, which is the actual exit code.... (1 Reply)
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (1 Reply)
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (10 Replies)
Hi All
Its strange or i am doing it wrong.When find run successful it return exit status 0.And same if it didn't run successfully it return zero.
find /var/www/html -maxdepth 1 -type f -name *.dsadas
echo $?
0
find /var/www/html -maxdepth 1 -type f -name *.php... (1 Reply)
Hi All,
I have developed below script for FTP a file from unix machine to another machine.
ftpToABC ()
{
USER='xyz'
PASSWD='abc'
echo "open xx.yy.zbx.aaa
user $USER $PASSWD
binary
echo "put $1 abc.txt" >> /home/tmp/ftp.$$
echo "quit" >> /home/tmp/ftp.$$
ftp -ivn <... (3 Replies)
I have written the following script to update some Debian boxes.
#!/bin/bash
mxg_hosts_file="/etc/mxg/ssh-hosts"
while read line ; do
mxg_host="$(echo ${line} | awk -F":" '{print $1}')"
mxg_port="$(echo ${line} | awk -F":" '{print $2}')"
echo "Connecting and Upgrading... (3 Replies)
Hello;
I regularly run monitoring scripts over ssh to monitoring scripts
But whenever a server is hung or in maintenance mode, my script hangs..
Are there anyways to trap exit status and be on my way ??
Looked at the ssh manpage and all I can see is a "-q" option for quiet mode ..
Thank... (2 Replies)
Hi All,
I have a peculiar requirement as follows,
I have a some hosts on which i have to run a script, so i am using the following code piece
for i in $HOSTLIST
do
ssh ${i} "~/task.sh"
done
Now i want to run this same thing in parallel on all the hosts and then monitor the ssh process... (1 Reply)
see below for a housekeeping script which constructs an ssh cmd using some server/path/sudo info found in $HRINST.
the script should hop to each server and if it finds a file to cleanup, moves it to the archive dir
if there is nothing to move, it should report so and email the output
... (3 Replies)
Hi All,
this is the very first time i am going to use SSH authentication. first i login to server@ and under this ..ssh directory of servera i used this following command:
ssh-keygen -t rsa -b 1024
and i had 2 files(bravo_dbtest and bravo_dbtest.pub) created respectively, further i copied the... (13 Replies)
Discussion started by: lovelysethii
13 Replies
LEARN ABOUT OPENDARWIN
tcl_setstdchannel
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 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)