On Thu, 20 Mar 2008, J.Pietschmann wrote:
Matt Healy wrote:
I went back and checked the script, and found that IFS is being set just
to the newline character, and does not include spaces.

This is intentional: it avoids splitting directorie names which
contain spaces, which is rather common now especially on Windows.

How about this as an alternative, then: simply move the assignment to (and export of) IFS to a point immediately *after* the evaluation of the command-line arguments. In this way, the loop will appropriately differentiate between the arguments, rather than failing to break the evaluation of '"$@"' on the spaces between quoted values.

In other words, rewrite:

        export IFS="
        "
        for arg in "$@" ; do
          . . . .
        done

as:

        for arg in "$@" ; do
          . . . .
        done
        export IFS="
        "

The content within the "for" loop appears to be space-friendly, since it's using escaped double-quotes to build up the content of the "fop_exec_args" variable from the values of "$arg", and no other potential file names are being used in the loop.

I think this should maintain the space-friendly nature of all of the subsquent code, while letting the "for" loop parse the data in a way that is compliant with Bourne shell under Solaris (and possibly other platforms) where the current code does not.

(Hopefully I haven't missed anything.... ;-)

-mjh
--
Matthew J. Healy
Computer Science & Information Technology Departments
Golisano College of Computing and Information Sciences, RIT
mailto:[EMAIL PROTECTED]
http://www.cs.rit.edu/~mjh
Voice: (585) 248-3425


J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to