Parsing a string with quotations

In an act of escape gymnastics worthy of Houdini, you can try the following:

julia> s = "-a AA -b BB"
"-a AA -b BB"

julia> readlines(`sh -c "for arg in $s; do printf \"%s\\n\" \"\$arg\" ; done"  0`)
4-element Vector{String}:
 "-a"
 "AA"
 "-b"
 "BB"

julia> s = "-f \"C:\\\\user folder\\\\\""
"-f \"C:\\\\user folder\\\\\""

julia> v = readlines(`sh -c "for arg in $s; do printf \"%s\\n\" \"\$arg\" ; done"  0`)
2-element Vector{String}:
 "-f"
 "C:\\user folder\\"

julia> println(v[2])
C:\user folder\

julia> println(s)
-f "C:\\user folder\\"

The goal is to use the actual command shell to parse the arguments. And it works. The DOS style paths with the backslash directory separator posed an additional challange. But this challange may be present even in ideal cases.

Also, historical note, Houdini actually died from his escape artistry.