![]() |
|
|
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 condition doubt | ravi raj kumar | Shell Programming and Scripting | 1 | 03-05-2008 11:16 AM |
| Condition test | felixwhoals | UNIX for Dummies Questions & Answers | 2 | 12-22-2007 08:47 AM |
| test and if condition | ciroredz | Shell Programming and Scripting | 9 | 06-27-2007 10:17 AM |
| need help with test condition in shell script | pieman8080 | Shell Programming and Scripting | 9 | 09-11-2006 06:20 PM |
| Bad day !! test condition failed --need a one liner to do --help | jambesh | Shell Programming and Scripting | 13 | 09-06-2006 09:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi ,
I have a doubt on condition test ( [[ ]] ). Pls refer blow program. #!/bin/ksh TEMP= if [ -n $TEMP ];then echo $TEMP else print 'invalid option' fi Above script's TEMP variable has no value so it gives "invalid option" as output. But I got an error before priting the string . Result : ./test.ksh[3]: test: argument expected invalid option #!/bin/ksh TEMP= if [[ -n $TEMP ]];then echo $TEMP else print 'invalid option' fi Result: invalid option After I tried IF conditon with condition test [[ ]] , I did not see the error (./test.ksh[3]: test: argument expected ). Why I don't see the error now?. How Condition test [[ ]] is actually working ?. How [[ ]] differ from normal if condition? Regards, Thambi |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|