[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Escaping special characters for *nix file path
On 29/07/2012, Liam R E Quin <liam@xxxxxx> wrote: > On Sun, 2012-07-29 at 15:58 +0200, Wolfgang Laun wrote: > >> A relatively safe way would be to enclose the path name in apostrophes >> (') and escape all contained apostrophes and backslashes with a >> backslash. > > It would be if it worked :-) > > \ is not special inside '...' in the shell, and neither are ` or $ > (in shell-speak, no interpolation happens and there is no escaping) Ah, yes, confused... Thanks. However, ... > > This is all about escaping from the shell, though. On Unix (and Linux > and OS X) a filename can contain any character except NUL (a zero byte) > or / (because that's the path separator). ...it seemed to me that the OP was worried by the shell's input interpretation, and so my warning, at least, applies - if not the cure ;-) > > If the resulting files are going to be accessed as URIs though, you also > have to avoid a ton of other characters, and \-escaping doesn't work - > you have to use uri-escape(), and in that case there's no need to mess > around with backslashes either. > > But all this presupposes particular uses -- presumably XSLT is being > used to generate a shell script here. So I thought, too -W > > Liam
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|