I have a problem when i run this piece of script, and do echo $? it always gives me value 0, even if the string "CCRCWebServerINSTALLDIR" is not present in that file. Why is that so, can you give me suggestion to the changes i need to make?
'$?' is among some of the special parameters that are designated by the shel for yielding information about the environment in general and the process being executed.
'$?' is the exit status of the last executed command , which is 0 for success and 1 for failure
list of other parameters are...
$$- PID of current shell
$!- PID of last background process
$- -current shell settings
$#- total no. of positional parameters
$0 - name of the command being executed
$* - list of all shell arguments. Cant yield each argument separately
$# - similar to $*, but yields each argument separately when enclosed with double quotes.