home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ipo-101.zip
/
Samples.zip
/
CAT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-11-15
|
793b
|
37 lines
(*****************************************************************
** PURPOSE: Writes one or more files to the standard output.
** Similar to the UNIX command 'cat'
*)
program cat(output);
var
i : integer;
procedure ShowSyntax;
begin
writeln('cat: Writes one or more files to the standard output');
writeln('Syntax: cat files ...');
halt
end;
procedure write_file(name : string);
var
f : text;
c : char;
begin
assign(f, name);
reset(f);
while not eof(f) do
begin
read(f, c);
write(c)
end;
close(f)
end;
begin
if paramcount = 0 then
ShowSyntax;
for i := 1 to paramcount do
write_file(paramstr(i))
end.