On Thu, 24 Mar 2011, Mattias Gaertner wrote:

Hi all,

I would like to execute small pascal programs like normal unix
scripts. For example:

#!/usr/bin/instantfpc
begin
 writeln('shebang executed');
end.

Has anyone already written a tool, that compiles and
runs the program?

As far as I know, the "!/something just means, start /something, and pass current filename as a commandline param ?

So all your tool has to do is write all except the first line to a temp file, compile temp file and execute it ?

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to