0

What is the meaning of the following statement in shell script?

if ($?REGRESS) then
....
endif

from where the given function is taking input from? This is a part of an old script which I am not able to understand.

halfer
  • 19,824
  • 17
  • 99
  • 186
nailed IT
  • 101
  • 2
  • 5

2 Answers2

2

From the csh the man page:

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

But stop using csh (obligatory comment for future readers who may have somehow missed the memo that using csh is bad for you health).

William Pursell
  • 204,365
  • 48
  • 270
  • 300
0

$? is a special variable. It stores the exit status of last command. If the last command runs successfully then it will be 0 and some other value for failure.

atul jha
  • 3
  • 1
  • 6