Sruku
Sruku

Reputation: 1

what does the following "$?run" mean in shell csh

What $?run does in the following example? run is variation with run directory. I understand that $? has the status of the last command.

if ( ! $?run ) then  
  set run = $PWD
endif

Upvotes: 0

Views: 32

Answers (1)

Martin Tournoij
Martin Tournoij

Reputation: 27842

You can use $?var_name to check if a variable is defined. From man csh:

   $?name
   ${?name}
           Substitutes the string `1' if name is set, `0' if it is not.

This is not the same as the special $? variable (yeah, the syntax is a bit confusing).

Upvotes: 1

Related Questions