This is an appendix to Understanding Unix/Linux
Programming
written for people interested in Ada programming on POSIX
systems.
Copy from standard input to standard output:
with Ada.Text_IO;
procedure Copy is
use Ada.Text_IO;
C : Character;
begin
while not End_Of_File loop
Get (C);
Put (C);
end loop;
end Copy;
Here is a first draft of more: more01.adb
Compile and run it like this:
% gnatmake more01 % ./more01 more01.adb % ls /bin | ./more01
Compare with the system version of more:
% more more01.adb % ls /bin | more
With this new knowledge, we can enhance more01.adb to
more02.adb: more02.adb
Compile and test this version:
% gnatmake more02 % ls /bin | ./more02
Go to next chapter.
Understanding Unix/Linux Programming, Bruce Molay,
ISBN 0-13-008396-8.