Exercises
Write a program to check whether two files are equal. Make sure that it works on binary files.
Write a conversion program that converts text files between the various end-of-line style formats. The three formats available are
UNIX/Linux— End of line is linefeed (\012).
Microsoft Windows— End of line is carriage-return/linefeed (\015\012).
Apple— End of line is carriage-return (\015).
Write two programs that communicate to each other through a shared file.
Write a replacement for the command more that pages through text. Include a capability to go back.
Write a program that goes through a log file and checks to see whether any lines match a particular pattern. The program should not exit; rather, it should wait for the file to grow, and ...
Get Perl for C Programmers 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.