what is the difference between a while statement and a do statement?
Ans:
A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.
2
what is the difference between a break statement and a continue statement?
Ans:
A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to the loop statement.
3
what does break and continue statements do?
Ans:
Continue statement continues the current loop (if label not specified) in a new iteration whereas break statement exits the current loop.
4
how can you tell what shell you are running on unix system?
Ans:
You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID.
5
what is the difference between a pointer and a reference?
Ans:
You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID.