3
{ Program to demonstrate the Popen function. }
11
writeln ('Creating a shell script to which echoes its arguments');
12
writeln ('and input back to stdout');
15
writeln (f,'#!/bin/sh');
16
writeln (f,'echo this is the child speaking.... ');
17
writeln (f,'echo got arguments \*"$*"\*');
22
fpchmod ('test21a',&755);
23
popen (f,'./test21a arg1 arg2','W');
25
writeln ('error from POpen : errno : ', fpgeterrno);
27
writeln (f,'This is written to the pipe, and should appear on stdout.');
29
Writeln ('The script exited with status : ',PClose (f));
31
writeln ('Press <return> to remove shell script.');
b'\\ No newline at end of file'