Sponsored Content
Top Forums Shell Programming and Scripting If condition to check null variable Post 302831399 by vidyadhar85 on Thursday 11th of July 2013 02:02:36 AM
Old 07-11-2013
put NULL in double quotes.. and if you are equating string better use = than -eq
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check for NULL variable

Hello I want to check for NULL variable.. but this is not working..please help thanks in advance esham (2 Replies)
Discussion started by: esham
2 Replies

2. Shell Programming and Scripting

How can find Null value in If condition

Hi, i wrote If Conditions in my script, it's returns null and some values. but i am unable to find when Null value getting. bec we need modification according null vales. pls help me on this. (2 Replies)
Discussion started by: koti_rama
2 Replies

3. Shell Programming and Scripting

how to check null variable

korn shell If then update_smartcare_user_password "$u_id" else echo "Not a database user" fi i get this error Syntax error at line *** : `then' is not expected. what should i do. I want to check whether $a is null or not. (2 Replies)
Discussion started by: sachin.gangadha
2 Replies

4. UNIX for Dummies Questions & Answers

How to compare null and space using single if condition

Hi I have a input file with many fields and each filed will be with in double quotes(""). i want to check fields contains balnk,null or space using condition using if. when i write code as below for if condition its not working a=`awk -F ',' '{gsub("\"", "", $1);'NF==0';printf $1}'... (3 Replies)
Discussion started by: jayakumarrt
3 Replies

5. Shell Programming and Scripting

csh if loop variable condition check peroblem

Hi, I have variables like var1 var2 var3 var4 in if loop i am trying to check the condition if(variable == "var") then echo $variable endif (0 Replies)
Discussion started by: vasanth.vadalur
0 Replies

6. Shell Programming and Scripting

check for null

hi, i have 3 lines of output , if second line exists then only condition within the if loop has to exeute other wise it has exit from loop. i had tried like this but not getting please help me ... Code: if ; then echo "success" else echo "" Use code tags please,... (8 Replies)
Discussion started by: sreelu
8 Replies

7. Shell Programming and Scripting

Check for null

Hi Champs!!! im a newbie in unix, need ur expert help for my problem... I need to search if there are any "NULL" entries in the string String without Null Str1: 203652|1000003653|tellt|RUPV|4649|1|07/28/2011 01:56:12 String with Null (RUPV is removed) Str2:... (5 Replies)
Discussion started by: guruprasad7
5 Replies

8. Shell Programming and Scripting

HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?

Hello experts, I'm stuck with this script for three days now. Here's what i need. I need to split a large delimited (,) file into 2 files based on the value present in the last field. Samp: Something.csv bca,adc,asdf,123,12C bca,adc,asdf,123,13C def,adc,asdf,123,12A I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies

9. Shell Programming and Scripting

Check null value in xml

Hi, I have a log file which is having some xml tags. I need to check the value for a particular xml field is null or not and if it is null i have to add current time as the value for that xml field. I tried below code to check whether the word count is 0. But even if the xml field is null it... (16 Replies)
Discussion started by: Neethu
16 Replies

10. Shell Programming and Scripting

Checking for null condition in a UNIX variable

i have this code for i in `cat sql_output.txt` do -- some script commands done sql_output.txt has 1 column with employee_ids If the sql_output.txt is null then the do loop should not execute. How can i implement this. for i in `cat sql_output.txt` If i is null or empty then ... (5 Replies)
Discussion started by: rafa_fed2
5 Replies
Tcl_DoubleObj(3)					      Tcl Library Procedures						  Tcl_DoubleObj(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_NewDoubleObj, Tcl_SetDoubleObj, Tcl_GetDoubleFromObj - manipulate Tcl objects as floating-point values SYNOPSIS
#include <tcl.h> Tcl_Obj * Tcl_NewDoubleObj(doubleValue) Tcl_SetDoubleObj(objPtr, doubleValue) int Tcl_GetDoubleFromObj(interp, objPtr, doublePtr) ARGUMENTS
double doubleValue (in) A double-precision floating point value used to initialize or set a double object. Tcl_Obj *objPtr (in/out) For Tcl_SetDoubleObj, this points to the object to be converted to double type. For Tcl_GetDoubleFro- mObj, this refers to the object from which to get a double value; if objPtr does not already point to a double object, an attempt will be made to convert it to one. Tcl_Interp *interp (in/out) If an error occurs during conversion, an error message is left in the interpreter's result object unless interp is NULL. double *doublePtr (out) Points to place to store the double value obtained from objPtr. _________________________________________________________________ DESCRIPTION
These procedures are used to create, modify, and read double Tcl objects from C code. Tcl_NewDoubleObj and Tcl_SetDoubleObj will create a new object of double type or modify an existing object to have double type. Both of these procedures set the object to have the double- precision floating point value given by doubleValue; Tcl_NewDoubleObj returns a pointer to a newly created object with reference count zero. Both procedures set the object's type to be double and assign the double value to the object's internal representation doubleValue member. Tcl_SetDoubleObj invalidates any old string representation and, if the object is not already a double object, frees any old inter- nal representation. Tcl_GetDoubleFromObj attempts to return a double value from the Tcl object objPtr. If the object is not already a double object, it will attempt to convert it to one. If an error occurs during conversion, it returns TCL_ERROR and leaves an error message in the interpreter's result object unless interp is NULL. Otherwise, it returns TCL_OK and stores the double value in the address given by doublePtr. If the object is not already a double object, the conversion will free any old internal representation. SEE ALSO
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult KEYWORDS
double, double object, double type, internal representation, object, object type, string representation Tcl 8.0 Tcl_DoubleObj(3)
All times are GMT -4. The time now is 10:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy