Guys any tips on printing a certain error message to stderr and exiting should a command fail within a ksh script? I'm trying to null some output files.
Touch isn't suitable as i need to null them.
print "" > file isn't suitable as i need to check elsehere for if they are 0bytes or not.
... (5 Replies)
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)
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
Hello All
My req is to store the exit status of a command in shell variable
I want to check whether the file has header or not
The header will contain the string
DATA_ACQ_CYC_CNTL_ID
So I am running the command
head -1 $i | grep DATA_ACQ_CYC_CNTL_ID
Now I have to check if... (6 Replies)
Hi,
Can anyone help me how to exit a shell script if a unix command inside does not return any value for 10 seconds?
The scenarios is like this.
I want to login to a application using shell script where the connection string is mentioned.but suppose this connection string is not... (10 Replies)
Hi,
I am writing shell script to automate few use cases for CLI interface. We have CLI interface which has bunch of commands. I am trying to execute one of the commands 'exit' as part of automation to exit from CLI object (not from shell script) in my shell script.
My intension is to execute... (4 Replies)
Hi,
I am looking for a generic find command that works on both Linux and Solaris.
I have the below command that works fine on Linux but fails on solaris.find /web/config -type f '(' -name '*.txt' -or -name '*.xml' -name '*.pro' ')' Fails on SunOS mysolaris 5.10 Generic_150400-61 sun4v sparc... (1 Reply)
I wish to replace "\\n" with a single white space.
The below does the job on command-line:
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g';
/fin/app/scripts /fin/app/01/sql
However, when i have the same code to a shell script it is not able to get me the same output:... (8 Replies)
Discussion started by: mohtashims
8 Replies
LEARN ABOUT CENTOS
tcl_backgrounderror
Tcl_BackgroundError(3) Tcl Library Procedures Tcl_BackgroundError(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_BackgroundError - report Tcl error that occurred in background processing
SYNOPSIS
#include <tcl.h>
Tcl_BackgroundError(interp)
ARGUMENTS
Tcl_Interp *interp (in) Interpreter in which the error occurred.
_________________________________________________________________DESCRIPTION
This procedure is typically invoked when a Tcl error occurs during "background processing" such as executing an event handler. When such
an error occurs, the error condition is reported to Tcl or to a widget or some other C code, and there is not usually any obvious way for
that code to report the error to the user. In these cases the code calls Tcl_BackgroundError with an interp argument identifying the
interpreter in which the error occurred. At the time Tcl_BackgroundError is invoked, the interpreter's result is expected to contain an
error message. Tcl_BackgroundError will invoke the command registered in that interpreter to handle background errors by the interp bger-
ror command. The registered handler command is meant to report the error in an application-specific fashion. The handler command receives
two arguments, the result of the interp, and the return options of the interp at the time the error occurred. If the application registers
no handler command, the default handler command will attempt to call bgerror to report the error. If an error condition arises while
invoking the handler command, then Tcl_BackgroundError reports the error itself by printing a message on the standard error file.
Tcl_BackgroundError does not invoke the handler command immediately because this could potentially interfere with scripts that are in
process at the time the error occurred. Instead, it invokes the handler command later as an idle callback.
It is possible for many background errors to accumulate before the handler command is invoked. When this happens, each of the errors is
processed in order. However, if the handle command returns a break exception, then all remaining error reports for the interpreter are
skipped.
KEYWORDS
background, bgerror, error, interp
Tcl 7.5 Tcl_BackgroundError(3)