[Swift-devel] Q about wrapper.sh

Mihael Hategan hategan at mcs.anl.gov
Thu Oct 30 18:40:45 CDT 2008


I have a feeling we've had this discussion before, but system() invokes
a subshell (i.e. /bin/bash) to execute your command, and will do all
kinds of redirection nastiness.

Use fork/execve instead.

On Thu, 2008-10-30 at 18:35 -0500, Zhao Zhang wrote:
> using system function in c library.
> 
> zhao
> 
> Mihael Hategan wrote:
> > On Thu, 2008-10-30 at 17:39 -0500, Zhao Zhang wrote:
> >   
> >> I made a small script with that getarg() part, and tried parse "-if 
> >> iofiles/DataInit1.txt|iofiles/ApproxData1.txt"
> >>
> >> bash-3.1# ./getarg.sh
> >> iofiles/DataInit1.txt|iofiles/ApproxData1.txt
> >>
> >> This output is right, but the same code in wrapper.sh doesn't work like 
> >> this.
> >>     
> >
> > Heh. Not quite. Something in between swift and the wrapper invocation
> > does funny things when it sees a "|". How does the worker invoke
> > executables?
> >
> >
> >   




More information about the Swift-devel mailing list