![]() |
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 |
| 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 |
| if statement | ramky79 | Shell Programming and Scripting | 6 | 05-29-2008 03:17 AM |
| IF Statement | koti_rama | Shell Programming and Scripting | 3 | 04-29-2008 04:48 AM |
| If statement - How to write a null statement | april | Shell Programming and Scripting | 3 | 04-16-2008 01:14 PM |
| IF statement on a df -g | hassanj | UNIX for Advanced & Expert Users | 1 | 12-18-2007 07:41 AM |
| If statement | mariner | UNIX for Advanced & Expert Users | 4 | 12-16-2004 07:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi All,
Can some one tell me how to get run the following: data1="hello" data2="world" if [ "$data2" != "world" && "$data1" != "hello"] then { echo "good afternnon" } else { echo " good morning" } fi The above code gives me an error ad below : ./if.h: line 3: [: missing `]' Thanks in advance Js |
|
||||
|
Don't forget to let a space before ] and after [ !
Here is the code : Code:
data1="hello"
data2="world"
if [ "$data2" != "world" ] && [ "$data1" != "hello" ]
then
{
echo "good afternnon"
}
else
{
echo " good morning"
}
fi
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|