How can I check if a variable is empty or not in tcsh Shell?
问题 IF I have to check that if a variable is empty or not for that in bash shell i can check with the following script: if [ -z "$1" ] then echo "variable is empty" else echo "variable contains $1" fi But I need to convert it into tcsh shell. 回答1: The standard warnings regarding use of tcsh / csh apply, but here's the translation: if ( "$1" == "" ) then # parentheses not strictly needed in this simple case echo "variable is empty" else echo "variable contains $1" endif Note, though, that if you