Advanced Exercises

10. In the makercs (page 812) program, file descriptors 3 and 4 are opened; during the loop, output is directed to these descriptors. An alternative method would be simply to append the output each time it occurs, using, for example,
print "Cannot create $target" >> $ERRS 

rather than

print –u3 "Cannot create $target" 

What is the difference? Why does it matter?

11.The check in makercs (page 812) to prevent you from copying hierarchies on top of each other is simplistic. For example, if you are in your home directory, the call makercs . ~/work/RCS will not detect that the source and target directories lie on the same path. Fix this check.
12.In principle, recursion is never necessary. It can always be replaced by an iterative ...

Get A Practical Guide to Red Hat® Linux® 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.