The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to check for null or empty string doer Shell Programming and Scripting 5 07-24-2007 01:31 AM
test Null variable kykyboss Shell Programming and Scripting 1 11-24-2006 12:02 PM
check for not null string in file misenkiser Shell Programming and Scripting 6 10-23-2006 10:39 AM
check for NULL variable esham Shell Programming and Scripting 2 03-20-2005 03:31 AM
PERL: how to tell if variable is NULL dangral Shell Programming and Scripting 4 03-19-2003 01:34 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-06-2007
sachin.gangadha sachin.gangadha is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 37
how to check null variable

korn shell

If [ "$a" != "" ]
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 (permalink)  
Old 12-06-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Code:
if [ "$a" != "" ]
then
     update_smartcare_user_password "$u_id"
else
     echo "Not a database user"
fi
I presume the 'I' was supposed to be 'i'?
  #3 (permalink)  
Old 12-06-2007
sachin.gangadha sachin.gangadha is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 37
thank you very much porter. It was 'I' that wasted my hour. Seriouly debugging sucks when you have couple of hundreds lines of code. once again thanx
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0