system command to copy a file to a path with a space in it

Fairlight fairlite at fairlite.com
Wed Mar 25 10:07:08 PDT 2015


Note that if you ever needed to use, say, and environment variable in the
target (e.g., /reports/$LOGNAME.pdf), you want -double quotes- around the
target, not single quotes, as double quotes would allow interpolation,
while single-quotes prevent it.

mark->

On Wed, Mar 25, 2015 at 10:36:27AM -0400, Josh Reader thus spoke:
> Thanks to all who replied!  Either of the following methods worked
> perfectly:
> 
> 
> 
> Option 1
> 
> -----------
> 
> cm = "/bin/cp /reports/state.pdf \"/reports/Josh Reader/josh.pdf\""
> 
> system cm
> 
> 
> 
> Option 2
> 
> ----------
> 
> system "/bin/cp /reports/state.pdf '/reports/Josh Reader/josh.pdf'"
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20150325/8398bbd0/attachment.html>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
> 

-- 
Audio panton, cogito singularis.


More information about the Filepro-list mailing list