Hi
I have the following columns in my input file which is sorted on ColA
colA colB colC colD colE
The data is such that for a single colA it can have multiple values of other columns, for eg the data can be
colA colB colC ... (1 Reply)
Hi guys--
Here is the interesting problem..
I have a folder, which has a couple of xml files like ( could be anywhere under the sub folders)
ABCD_NA.xml
XAYSGD_SC.xml
CBV_CA.xml
etc
I need to peek in each of these xml's and see that the pattern before the _ and after the _ are there... (0 Replies)
Hello Friends,
Can you pls advice me on the following requirement:
What we'd like to achieve is the following:
- having a password.properties file which contains some passwords, e.g. BOT_PASSWORD=dog.name
- in the configuration file, insert as the password value something like... (0 Replies)
i need to search the starting line
example we have
-sh
shl-js-gd
i need to search only starting -sh not the other
i have used cmd
cat filename | grep '-'
but it will check for complete - in the file
please help me to search only starting -
thank u
revenna (0 Replies)
Hi all,
I'm a newbie. I'm thinking of making a shell script which will list a directory for *.csv files and merge all the files into a single file called data.csv.
However, i have no idea how to. What i do currently is to manually issue the following command to merge multiple CSV files into... (1 Reply)
i am trying to read an existing xml file and find an element in the xml file of following format
<home.dir value="/local/mnt/homes/docs"/>
I am trying to take a command line argument to my shell script whose value should replace /local/mnt/homes/docs in xml document.
Can you please point me how... (3 Replies)
Hi all,
I need to modify the below highlighted piece to perform the below task. Please let me know as i am not able to figure out a way to do this.
|| FILENAME=$(date +"$FILENAME")
if ; then
do_log FATAL "FILENAME needs to be set if SWITCH2=0"
exit 1
fi... (3 Replies)
Hi I want a script which should basically do
1. If the size of the file is 0kb,
send email to some list od ppl
2. if the size of the file is other than 0kb
send email to someother list...
Pls help (2 Replies)
Hi,
I have trouble building the logic for the following, could anyone please help me out with this:
Im working on a wrapper script to check for input files (in a specific directory) and pass
the input files along with the options as parameters to the main script.The options vary depending ... (2 Replies)
I want to take out the Z1 value from the lscfg outpu and use the below command to get it
lscfg -vl hdisk0 | grep "Device Specific.(Z1)" | awk -F. '{print $NF}'
# lscfg -vpl hdisk0
.
.
Device Specific.(Z0)........0000063268181002
Device Specific.(Z1)........020064a
.
And it works,... (2 Replies)
Discussion started by: moorthikv
2 Replies
LEARN ABOUT MOJAVE
catch
catch(n) Tcl Built-In Commands catch(n)
__________________________________________________________________________________________________________________________________________________NAME
catch - Evaluate script and trap exceptional returns
SYNOPSIS
catch script ?resultVarName? ?optionsVarName?
_________________________________________________________________DESCRIPTION
The catch command may be used to prevent errors from aborting command interpretation. The catch command calls the Tcl interpreter recur-
sively to execute script, and always returns without raising an error, regardless of any errors that might occur while executing script.
If script raises an error, catch will return a non-zero integer value corresponding to the exceptional return code returned by evaluation
of script. Tcl defines the normal return code from script evaluation to be zero (0), or TCL_OK. Tcl also defines four exceptional return
codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK), and 4 (TCL_CONTINUE). Errors during evaluation of a script are indicated by a return
code of TCL_ERROR. The other exceptional return codes are returned by the return, break, and continue commands and in other special situa-
tions as documented. Tcl packages can define new commands that return other integer values as return codes as well, and scripts that make
use of the return -code command can also have return codes other than the five defined by Tcl.
If the resultVarName argument is given, then the variable it names is set to the result of the script evaluation. When the return code
from the script is 1 (TCL_ERROR), the value stored in resultVarName is an error message. When the return code from the script is 0
(TCL_OK), the value stored in resultVarName is the value returned from script.
If the optionsVarName argument is given, then the variable it names is set to a dictionary of return options returned by evaluation of |
script. Tcl specifies two entries that are always defined in the dictionary: -code and -level. When the return code from evaluation of |
script is not TCL_RETURN, the value of the -level entry will be 0, and the value of the -code entry will be the same as the return code. |
Only when the return code is TCL_RETURN will the values of the -level and -code entries be something else, as further described in the doc- |
umentation for the return command. |
When the return code from evaluation of script is TCL_ERROR, three additional entries are defined in the dictionary of return options |
stored in optionsVarName: -errorinfo, -errorcode, and -errorline. The value of the -errorinfo entry is a formatted stack trace containing |
more information about the context in which the error happened. The formatted stack trace is meant to be read by a person. The value of |
the -errorcode entry is additional information about the error stored as a list. The -errorcode value is meant to be further processed by |
programs, and may not be particularly readable by people. The value of the -errorline entry is an integer indicating which line of script |
was being evaluated when the error occurred. The values of the -errorinfo and -errorcode entries of the most recent error are also avail- |
able as values of the global variables ::errorInfo and ::errorCode respectively. |
Tcl packages may provide commands that set other entries in the dictionary of return options, and the return command may be used by scripts |
to set return options in addition to those defined above.
EXAMPLES
The catch command may be used in an if to branch based on the success of a script.
if { [catch {open $someFile w} fid] } {
puts stderr "Could not open $someFile for writing
$fid"
exit 1
}
There are more complex examples of catch usage in the documentation for the return command.
SEE ALSO
break(n), continue(n), dict(n), error(n), return(n), tclvars(n)
KEYWORDS
catch, error
Tcl 8.5 catch(n)