04-12-2011
I think that the (( expression )) is not standard.
The $(( expression )) is standard.
If that matters, of course.
Last edited by radoulov; 04-12-2011 at 04:46 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
i am new to UNIX. I have couple of basic questions.
1. Is the syntax for BASH shell programming same in the LINUX and SUN SOLARIS operating systems?
2. I have to work on BASH shell programming in SUN SOLARIS operating system. I am going through the documentation from the following... (4 Replies)
Discussion started by: azazalis
4 Replies
2. Shell Programming and Scripting
Can any1 please help me...
i'm really lost in using bash shell scripting...
and i got to hand this up on monday...
please anyone teach me how to do this assignment...
Please use basic things because i just learn the program only... thanks
... (1 Reply)
Discussion started by: Fr0z3n999
1 Replies
3. Shell Programming and Scripting
wwww wwwwwwww wwwwwwwwwwwww (0 Replies)
Discussion started by: keyvan
0 Replies
4. Shell Programming and Scripting
Hi,
Actually i have written one test.sh (shell program) in bash.
Here i have a variables $a which stored the value package1.
Now I want to write a regular expression inside the if command that "if $a variable contains letter p in the begining of the value package1 then it is coming true.... (5 Replies)
Discussion started by: sunitachoudhury
5 Replies
5. Shell Programming and Scripting
Hi all,
Can anyone guide to get tricks for file handling in bash shell? Thanks in advance.
Thanks
Deepak (2 Replies)
Discussion started by: naw_deepak
2 Replies
6. Shell Programming and Scripting
#! /bin/sh
abcd = "Hello world"
if
then
echo $abcd
fi
i got error message that
line3 : abcd: command not found
line5 : [0: command not found
line5 : [1: command not found
i have no idea why i got this message. Can some one help me ??? (6 Replies)
Discussion started by: bonosungho
6 Replies
7. UNIX for Dummies Questions & Answers
i am new to shell scripting and stuck at one place in my program.
i am reading data from one structured file and extracting some data from particular lines and then writing into the output file. In that reading input file line by line from while loop.
while read line
do
rectype=line... (7 Replies)
Discussion started by: reeta_shri
7 Replies
8. Shell Programming and Scripting
Hello All,
I am setting up a cron job, where i am calling a shell script to make few builds. I got struck at a point, need some expert inputs to proceed further.
The script is categorized in 5 parts and in the last part while building software it asks for few questions like:-
1. Build mode... (4 Replies)
Discussion started by: sahil_jammu
4 Replies
9. UNIX for Dummies Questions & Answers
I'm having trouble trying to create a BASH shell script.
I want the user to input a command "cat file_name.c" and then the shell script will delete all comments "/* */" from file_name.c else exit.
So far I have this:
#!/bin/bash
read "cat file" // User will input command cat... (7 Replies)
Discussion started by: inkjoy00
7 Replies
10. UNIX for Dummies Questions & Answers
I do not know shell scripting. But at work place, I have got an in and out shell scripting task. I just need to understand a very big script. Is there any tool in which I can place the script and it can tell me the meaning of the whole script? (3 Replies)
Discussion started by: lg123
3 Replies
LEARN ABOUT OPENDARWIN
tcl_exprobj
Tcl_ExprLongObj(3) Tcl Library Procedures Tcl_ExprLongObj(3)
__________________________________________________________________________________________________________________________________________________
NAME
Tcl_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj, Tcl_ExprObj - evaluate an expression
SYNOPSIS
#include <tcl.h>
int
Tcl_ExprLongObj(interp, objPtr, longPtr)
int
Tcl_ExprDoubleObj(interp, objPtr, doublePtr)
int
Tcl_ExprBooleanObj(interp, objPtr, booleanPtr)
int
Tcl_ExprObj(interp, objPtr, resultPtrPtr)
ARGUMENTS
Tcl_Interp *interp (in) Interpreter in whose context to evaluate string or objPtr.
Tcl_Obj *objPtr (in) Pointer to an object containing the expression to evaluate.
long *longPtr (out) Pointer to location in which to store the integer value of the expression.
int *doublePtr (out) Pointer to location in which to store the floating-point value of the expression.
int *booleanPtr (out) Pointer to location in which to store the 0/1 boolean value of the expression.
Tcl_Obj **resultPtrPtr (out) Pointer to location in which to store a pointer to the object that is the result of the expression.
_________________________________________________________________
DESCRIPTION
These four procedures all evaluate an expression, returning the result in one of four different forms. The expression is given by the
objPtr argument, and it can have any of the forms accepted by the expr command.
The interp argument refers to an interpreter used to evaluate the expression (e.g. for variables and nested Tcl commands) and to return
error information.
For all of these procedures the return value is a standard Tcl result: TCL_OK means the expression was successfully evaluated, and
TCL_ERROR means that an error occurred while evaluating the expression. If TCL_ERROR is returned, then a message describing the error can
be retrieved using Tcl_GetObjResult. If an error occurs while executing a Tcl command embedded in the expression then that error will be
returned.
If the expression is successfully evaluated, then its value is returned in one of four forms, depending on which procedure is invoked.
Tcl_ExprLongObj stores an integer value at *longPtr. If the expression's actual value is a floating-point number, then it is truncated to
an integer. If the expression's actual value is a non-numeric string then an error is returned.
Tcl_ExprDoubleObj stores a floating-point value at *doublePtr. If the expression's actual value is an integer, it is converted to float-
ing-point. If the expression's actual value is a non-numeric string then an error is returned.
Tcl_ExprBooleanObj stores a 0/1 integer value at *booleanPtr. If the expression's actual value is an integer or floating-point number,
then they store 0 at *booleanPtr if the value was zero and 1 otherwise. If the expression's actual value is a non-numeric string then it
must be one of the values accepted by Tcl_GetBoolean such as ``yes'' or ``no'', or else an error occurs.
If Tcl_ExprObj successfully evaluates the expression, it stores a pointer to the Tcl object containing the expression's value at *resultP-
trPtr. In this case, the caller is responsible for calling Tcl_DecrRefCount to decrement the object's reference count when it is finished
with the object.
SEE ALSO
Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean, Tcl_ExprString, Tcl_GetObjResult
KEYWORDS
boolean, double, evaluate, expression, integer, object, string
Tcl 8.0 Tcl_ExprLongObj(3)