s5cmd icon indicating copy to clipboard operation
s5cmd copied to clipboard

Document escaping in s5cmd run

Open ewjoachim opened this issue 1 year ago • 1 comments

Hello,

How does own would write a file for s5cmd run when one needs to manipulate files containing spaces, single quotes etc ?

It looks like e.g. cp 'x y' 'zt' works (with single quotes) if the files contain spaces, but what if the file names also contains single quotes ?

1/ It's very nice if you have an answer 2/ It's even better if we can document this answer :)

Thank you !

ewjoachim avatar Nov 19 '24 14:11 ewjoachim

Hm, it seems that all the answers needed are here: https://github.com/peak/s5cmd/issues/713#issuecomment-2027644647 In particular:

the line is split via kballard/go-shellquote.Split "...according to /bin/sh's word-splitting rules"

So mainly, what's left is to make those parts documented.

ewjoachim avatar Nov 19 '24 14:11 ewjoachim