[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Escaping special characters for *nix file path
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. That my work in some shell, but not in bash, for example. In bash, in a single-qouted argument, backslash is a normal character, not an escape character. As a consequence, the apostrohpe cannot be included directly, since it cannot be escaped. Instead, the apostrophe has to be replaced by either apos-backsl-apos-apos ('\'') or apos-quot-apos-qout-apos ('"'"'): $ echo $SHELL /bin/bash $ touch 'a b"c$d!e?f&g*h\i'\''1' $ touch 'a b"c$d!e?f&g*h\i'"'"'2' $ ls -1 a b"c$d!e?f&g*h\i'1 a b"c$d!e?f&g*h\i'2 Markus
|
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
|