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

Rainer Stratmann rainerstratmann at t-online.de
Sun Jun 30 13:16:15 CEST 2013


 On Sunday 30 June 2013 12:32:30 you wrote:
> Rainer Stratmann wrote:
> >  On Sunday 30 June 2013 00:59:59 you wrote:
> >> I Tried, but only return an integer not a string value.
> > 
> > Thats right.
> > 
> > You have to put the result in a file and then afterwards read the file.
> > 
> > ls uname -r > file.txt
> 
> I'm sorry, but that's misleading on at least two accounts. The first is
> that redirection (> and so on) is a property of the shell, so it won't
> work unless you pass the entire command to a shell with (typically) the
> -c option. The second is that as linked by leledumbo earlier
> http://wiki.lazarus.freepascal.org/Executing_External_Programs there are
> specific facilities in the runtimes to do this sort of thing and they
> don't, as a rule, involve temporary files.
> 
> If I had to go on, what's that -r supposed to be doing?

It is not too difficult to find out.

If you speed up your engine then you can find out that he wants to know the 
actual Linux kernel number.

'uname -r'

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.



More information about the fpc-pascal mailing list