According to the following file (orignal one contains 200x times the same structure...) I was wondering if someone could help me to print <byte>??</byte> values
dear
i have one file regarding
>abshabja>sdksjbs>sknakna>snajxcls
so i want to be output like
>abshabja
>sjkabjb
>sknakna
>snajxcls
Any using awk or sed will help
thanks (2 Replies)
Good Day,
Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp.
sed -n '/regexp/{n;p;}' filename
What if my regexp is 3 word or a sentence. Im... (3 Replies)
Greetings all,
...here is yet another string of awk/sed questions from a RegExp-Challenged luser :eek:
I'm looking to have sed/awk do some clean-up on routing tables and to that end, I would like to do the following:
1.) If a line contains the word "masks" or "subnets" prepend CR/LF to... (16 Replies)
I am looking help in awk, quick overview. we will get feed from external system . The input file looks like below.
Detail Id Info Id Order Id STATUS Status Date FileDetail
99127942 819718 CMOG223481502 PR 04-17-2011 06:01:34PM... (7 Replies)
hello,
I want to replace awk with a perl one liner in unix.
i use in awk REGEX and FS ( field separator) because
awk syntaxes in different unix os versions have not the same behaviour.
Awk, Nawk and GNU Awk Cheat Sheet - good coders code, great reuse
i have a file named "file" and want... (5 Replies)
Hello,
I have a data file with 300,000 records in it, and another file which contains only the line numbers of roughly 13,000 records in the data file which have data integrity issues. I'm trying to find a way to print the original data by line number identified in the second file. How can I do... (2 Replies)
Hi All
I'm trying to extract the line just above a regexp and all lines after this.
I'm currently doing this in two steps
sed -n -e "/^+---/{g;p;}" -e h oldfile.txt > modified.txt
sed -e "1,/^+---/d" -e "/^$/d" oldfile.txt >>modified.txt
Sample
sometext will be here
sometext will be... (3 Replies)
How to use regexp to print out repetitive pattern in awk?
$ awk '{print $0, "-\t-\t-\t-\t-\t-\t-\t-\t-\t-\t-\t-"}' output:
- - - - - - - - - - - -I tried following which does not give what I want, of course.
awk '{print $0, "-\t{11}-"}'
output:
- ... (10 Replies)
I am trying to use awk to find all the $3 values in file2 that are between $2 and $3 in file1. If a value in $3 of file2 is between the file1 fields then it is printed along with the $6 value in file1. Both file1 and file2 are tab-delimited as well as the desired output. If there is nothing to... (4 Replies)
Hi All,
I need to print the characters in the previous line just before the regular expression match
Please have a look at the input file as attached
I need to match the regular expression ^ with the character of the previous like and also the pin numbers
and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
LEARN ABOUT DEBIAN
catch
catch(3tcl) Tcl Built-In Commands catch(3tcl)__________________________________________________________________________________________________________________________________________________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(3tcl), continue(3tcl), dict(3tcl), error(3tcl), return(3tcl), tclvars(3tcl)KEYWORDS
catch, error
Tcl 8.5 catch(3tcl)