2010-10-15 49 views
2

在CSH中,是否有可能嵌套變量存在的測試與測試其值在相同的if-子句中?CSH羣體存在測試與價值測試

#!/bin/csh 

# This seems to work... 
if ($?VAR) then 
    echo "VAR exists"   
    if ($VAR == true) then 
     echo "VAR is true" 
    endif 
endif 

# I want something more like this: 
if (($?VAR) && ($VAR == true)) then 
    echo "VAR exists and is true" 
endif 
+1

哇,這帶我回去.... – skaffman 2010-10-15 13:45:05

回答