[fpc-pascal] It is possible to pass command line to pascal

Rainer Stratmann rainerstratmann at t-online.de
Sun Jun 30 14:44:05 CEST 2013

 On Sunday 30 June 2013 14:14:56 you wrote:
> In which case why is he putting ls in front of it?

I guess he simply does not know by now and tries out something.

> -r is a valid option
> to both uname and ls, so since we're already looking at a broken command
> it's entirely valid to ask which it's supposed to apply to.

I bet he wants to know the Linux version.
'uname -r' is the unambiguous assignment for that.

> > With 'uname -r > file.txt' you redirect the output in a file.
> > Then cou can read the file.
> > 
> > I am sorry, but you try to make a very simple thing complicated.
> You might call having to invoke a shell with the -c option to get the
> redirection working, working out where to put the temporary file,
> deleting it on completion and making sure that all error conditions are
> handled "simple". I certainly don't.

It is not necessary to delete the file.
All error conditions you can read in the man page of the command.

> But as Marco has already reminded us, the information is already
> available from a standard library call.

Very good! Then you bet, too?

> Calling an external program is
> not something to be approached for a trivial reason, 

It works perfectly with linux. And is simple. The command is executed like 
every other function in your pascal program.

> unless you're
> writing shell or in a scripting language such as Perl where it might be
> less trouble than searching CPAN for the appropriate extension module. 

Why do you try to make it magotty and more complicated than necessary?

More information about the fpc-pascal mailing list