passing arguments to system command

Fairlight fairlite at fairlite.com
Tue Oct 3 10:52:11 PDT 2017


Another thing to keep in mind is which quotes you need.  You only need
double quotes if 1) the argument will need shell variable interpolation, or
2) the string will contain other single quotes, such as apostrophes.

If you can get away with single quotes, it becomes simpler still, since you
won't need to escape them.

As far as not working, I'd stuff everything into a variable, then msgbox it
so you can see exactly what is being passed to system().

m->

On Tue, Oct 03, 2017 at 01:45:02PM -0400, scooter6 at gmail.com thus spoke:
>    Hmm..not how I would have ever thought to do that... currently I pass
>    Â  <aa<ab<ac, etc......I would have assumed then I would have neededÂ
>    <"\"{ac{"\"    ?  But that didn't work...
>    I'll give this a try....thanks Mark
> 
>    On Tue, Oct 3, 2017 at 1:06 PM, Fairlight via Filepro-list
>    <[1]filepro-list at lists.celestial.com> wrote:
> 
>      aa = "/path/to/command" < "arg1" < "\"arg2 with spaces\"" < "arg3"
>      system aa
>      mark->
>      On Tue, Oct 03, 2017 at 12:56:39PM -0400, scooter6--- via
>      Filepro-list thus spoke:
> 
>    > I have a process that triggers an email at the end and I pass several
>    > variables to my shell script
>    > All of these parameters are short and contain  no spaces....
>    >
>    > How do I character escape a string I want to send my script that
>    would have
>    > spaces in it?
>    > Meaning how would I send literal " (quotes) around a longer variable
>    that
>    > has spaces in it?
>    >
>    >
>    > thanks
>    >
>    > Scott
> 
>      > -------------- next part --------------
>      > An HTML attachment was scrubbed...
>      > URL: <[2]http://mailman.celestial.com/pipermail/filepro-list/
>      attachments/20171003/4e49eb59/attachment.html>
>      > _______________________________________________
>      > Filepro-list mailing list
>      > [3]Filepro-list at lists.celestial.com
>      > Subscribe/Unsubscribe/Subscription Changes
>      > [4]http://mailman.celestial.com/mailman/listinfo/filepro-list
>      >
>      --
>      Audio panton, cogito singularis.
>      _______________________________________________
>      Filepro-list mailing list
>      [5]Filepro-list at lists.celestial.com
>      Subscribe/Unsubscribe/Subscription Changes
>      [6]http://mailman.celestial.com/mailman/listinfo/filepro-list
> 
> References
> 
>    1. mailto:filepro-list at lists.celestial.com
>    2. http://mailman.celestial.com/pipermail/filepro-list/attachments/20171003/4e49eb59/attachment.html
>    3. mailto:Filepro-list at lists.celestial.com
>    4. http://mailman.celestial.com/mailman/listinfo/filepro-list
>    5. mailto:Filepro-list at lists.celestial.com
>    6. http://mailman.celestial.com/mailman/listinfo/filepro-list

-- 
Audio panton, cogito singularis.


More information about the Filepro-list mailing list