Can anyone help please. I am writing a kourne shell script and I am unsure how to do the following:
I have extracted a time string from a logfile, and I have another time string I want to compare it to to see if it's later than the time I'm comparing with.
i.e. expectedSLA="23:00:00", ... (2 Replies)
i am used to making scripts for hp-ux. but lately i tried to make some for solaris. the problem is that when i tried to execute it it gave me an error the "let: not found". why is that? how can i perform an arithmetic function in the solaris shell script?
thanks :) (2 Replies)
okay, I'm a complete beginner, and I keep getting stuck on the syntax here. I want to write a script where I read the current time as minutes and seconds, convert the minutes to seconds, and add the two, then redirect the output to a file. the command takes two arguments, which will also be... (1 Reply)
Folks,
I am wondering that i can use something like this in one line.
For example, $((cat filename > wc -l) / 2)
It doesn't work; how to get it work using command substitution?
Moreover, is there any option for wc -l not to return filename after the line counts?
wc -l filename would... (3 Replies)
I am using egrep to extract numbers from a file and storing them as variables in a script. But I am not able to do any arithmetic operations on the variables using "expr" because it stores them as char and not integers. Here is my code and the error I get. Any help will be appreciated.
#!/bin/sh... (3 Replies)
Yes I know tcsh sucks for scripting and arithmetic but I have to write a script for multiple users and they all use tcsh.
I have this variable that I 'set' with but pulling numbers off of stings with
set STUFF = `grep string file | awk command`
Now I would like to add up the numbers that... (4 Replies)
Hello all,
I'd like to know how to perform arithmetic on multiple files. I have got many tab-delimited files. Each file contains about 2000 rows and 2000 columns.
What I want to do is to to sum the values in each row & column in every file.
The following explains what I want to do;
... (9 Replies)
Hello,
Could someone explain how this one is possible:
# @ x = 10 - 11 + 3
# echo $x
-4
I know that writing script using csh is bad idea, but I need to write few lines.
thanks
Vilius (2 Replies)
Hello.
LEAP_VERSION="4.2"
export ARRAY_MAIN_REPO_LEAP=('zypper_local' 'openSUSE-Leap-'"$LEAP_VERSION"'-Non-Oss' 'openSUSE-Leap-'"$LEAP_VERSION"'-Oss' 'openSUSE-Leap-'"$LEAP_VERSION"'-Update' 'openSUSE-Leap-'"$LEAP_VERSION"'-Update-Non-Oss')Seems that the - is interpreted as a numeric... (2 Replies)
I need to divide the number of white spaces by total number of characters in a file using bash. I am able to get the number of white spaces correctly using:
tr -cd < afile | wc -c
I am also able to get the total number of characters using:
wc -c afile
How do I divide the first... (2 Replies)
Discussion started by: ngabrani
2 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)