![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| String comparison | 46019 | Shell Programming and Scripting | 2 | 07-10-2009 02:56 AM |
| String Comparison | squardius | Shell Programming and Scripting | 3 | 04-30-2009 11:28 AM |
| Help with String Comparison | hypnotic_meat | Shell Programming and Scripting | 2 | 04-24-2009 08:48 AM |
| string comparison | fedora | Shell Programming and Scripting | 2 | 01-03-2007 03:20 PM |
| String Comparison | abey | High Level Programming | 1 | 10-19-2005 12:08 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need Help on String Comparison
Hi ,
My requirement is to read from a file into a variable. I need to check if the variable is equal to string "no rows selected". The sh script snippet is as follows: Code:
file=/data/lpgtwo/home/nikhilp/TriggerNames.txt
echo $file
var=`cat $file`
echo $var
if [ $var == "no rows selected" ]
then
echo "No Triggers to disable"
exit 1;
fi
I am new to shell script. Can some one please let me know where am I going wrong. Last edited by pludi; 10-12-2009 at 09:42 AM.. Reason: code tags please... |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| sh shell, string comparision, unix |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|