Hi everyone,
Im trying to write a Shell script that basically creates a set of files based on a file with many records. For example if a file called dummy has the following content:
a.txt
1st line of a's text file
2nd line of a's text file
3rd line of a's text file
b.txt
1st line of b's... (8 Replies)
Hi,
Let me explain the situation.
There are many files in a directory and its sub-directories that conatin the string pattern "pa". I want to replace all such instances with the pattern "pranavagarwal"
doing a
grep "pa" `ls`
does give me all the instances of the occurence of that... (3 Replies)
Hello
I do want to write a script which will check any errors say "-error" in the log file then have to send email to the concern person . And the concern person will correct the error .
Next time if the script runs eventhough the error has been corrected it will ... (1 Reply)
Hi,
I wish to format the output of a grep command in such a way that sed will be able to handle the newline characters held in the output.
Since sed does not allow newlines to be contained in a replacement pattern, that means adding a backslash '\' character to the end of each line from... (8 Replies)
Hi. This is my first post on the forums.
I am trying to write a script that will parse a folder of files "oneverylongfilenamexyz.pdf" and create a .dat file named "oneverylongfilenamexyz.dat" with the first line of each .dat file saying variable="xyz" where xyz is the last 14 characters of $i... (4 Replies)
I need help in the following script. I want to grep the sql errors insert into the error table and exit the shell script if there is any error, otherwise keep running the scripts.
Here is my script
#!/bin/csh -f
source .orapass
set user = $USER
set pass = $PASS
cd /opt/data/scripts
echo... (2 Replies)
Hi guys - below is my script that is checking for current file, size and timestamp.
However I added a "grep" feature in it (line in red), but not getting the desired result.
I am trying to acheive in output:
1. Show me the file name, timestamp, size and grep'ed words
It would be a... (2 Replies)
hi guys
very new to this game so excuse my ignorance. I need to create a script that simply greps for a text string and then outputs a message depending on whether the text string is there or not. The script I have setup is below, but whenever I run it I get the following error:
... (5 Replies)
Hi, I need to join these statements for efficiency, and without having to make a new directory for each batch. I'm annotating commands below.
wget -q -r -l1 URL
^^ can't use -O - here and pipe | to grep because of -r
grep -hrio "\b\+@\+\.\{2,4\}\+\b" * > first.txt
^^ Need to grep the output... (14 Replies)
Discussion started by: p1ne
14 Replies
LEARN ABOUT OPENDARWIN
return
return(n) Tcl Built-In Commands return(n)
__________________________________________________________________________________________________________________________________________________NAME
return - Return from a procedure
SYNOPSIS
return ?-code code? ?-errorinfo info? ?-errorcode code? ?string?
_________________________________________________________________DESCRIPTION
Return immediately from the current procedure (or top-level command or source command), with string as the return value. If string is not
specified then an empty string will be returned as result.
EXCEPTIONAL RETURNS
In the usual case where the -code option isn't specified the procedure will return normally (its completion code will be TCL_OK). However,
the -code option may be used to generate an exceptional return from the procedure. Code may have any of the following values:
ok Normal return: same as if the option is omitted.
error Error return: same as if the error command were used to terminate the procedure, except for handling of errorInfo and errorCode
variables (see below).
return The current procedure will return with a completion code of TCL_RETURN, so that the procedure that invoked it will return also.
break The current procedure will return with a completion code of TCL_BREAK, which will terminate the innermost nested loop in the code
that invoked the current procedure.
continue The current procedure will return with a completion code of TCL_CONTINUE, which will terminate the current iteration of the
innermost nested loop in the code that invoked the current procedure.
value Value must be an integer; it will be returned as the completion code for the current procedure.
The -code option is rarely used. It is provided so that procedures that implement new control structures can reflect exceptional condi-
tions back to their callers.
Two additional options, -errorinfo and -errorcode, may be used to provide additional information during error returns. These options are
ignored unless code is error.
The -errorinfo option specifies an initial stack trace for the errorInfo variable; if it is not specified then the stack trace left in
errorInfo will include the call to the procedure and higher levels on the stack but it will not include any information about the context
of the error within the procedure. Typically the info value is supplied from the value left in errorInfo after a catch command trapped an
error within the procedure.
If the -errorcode option is specified then code provides a value for the errorCode variable. If the option is not specified then errorCode
will default to NONE.
SEE ALSO
break(n), continue(n), error(n), proc(n)
KEYWORDS
break, continue, error, procedure, return
Tcl 7.0 return(n)