When might it be necessary or advisable to write a shell script instead of a shell function? Give as many reasons as you can think of.
What will be an ideal response?
Because the shell executes a shell function in the same environment as the
shell, it can change the values of variables and create new ones. If creating
new variables and modifying existing ones are not desirable, run a shell
script instead.
Having too many active functions can cause a shell to take a long time to
load, such as when you run a script. If you need to call a lot of routines from
a shell, you might want to make some of them scripts rather than functions.
You might also like to view...
What is another term for a null cipher?
A. Concealment cipher B. Substitution cipher C. Running key cipher D. Transposition cipher
In a multi-user game, the players move figures around a common scene. The state of the game is replicated at the players’ workstations and at a server, which contains services controlling the game overall, such as collision detection. Updates are multicast to all replicas.
(i) The figures may throw projectiles at one another and a hit debilitates the unfortunate recipient for a limited time. What type of update ordering is required here? Hint: consider the ‘throw’, ‘collide’ and ‘revive’ events. (ii) The game incorporates magic devices which may be picked up by a player to assist them. What type of ordering should be applied to the pick-up-device operation?