Re: RE : RE : RE : RE : [fpc-devel] Running programs with outputredirection

2011-07-17 Thread Jonas Maebe
On 17 Jul 2011, at 13:32, Ludo Brands wrote: > For this simple example it won't matter but for more complex ones using > certain shell specifics it is a must to launch the correct shell. The sh > symlink can point to anything. Yes, but bash may not even exist. Jonas ___

RE : RE : RE : RE : [fpc-devel] Running programs with outputredirection

2011-07-17 Thread Ludo Brands
> > Might be safer to refer to sh rather than bash in this context, since > Debian and Ubuntu are moving from Bash to Dash with sh being an > appropriate symlink. > For this simple example it won't matter but for more complex ones using certain shell specifics it is a must to launch the corre

RE : RE : RE : RE : [fpc-devel] Running programs with outputredirection

2011-07-17 Thread Ludo Brands
> > Cross platform solution: > > > > Uses process > > > > ... > > p:=TProcess.Create(nil); > > {$IFDEF WIN32} > > p.CommandLine := 'cmd /c diff -r dir1 dir2 > diff.txt'; {$ENDIF} > > {$IFDEF LINUX} > > p.CommandLine := 'bash -c "diff -r dir1 dir2 > diff.txt"'; > > {$ENDIF} > > p.Execute;