Open alisonatwork opened 9 years ago
In general, putting two forward slashes is the solution. Therefore, this works.
$ tasklist //?
TASKLIST [/S system [/U username [/P [password]]]]
[/M [module] | /SVC | /V] [/FI filter] [/FO format] [/NH]
...
This is what is called POSIX path conversion and is documented at http://www.mingw.org/wiki/Posix_path_conversion.
Unfortunately, I am running into a corner case where I am unable to resolve this problem.
rsync -rvztn --delete --exclude="/application/logs/" ...
I don't want the --exclude parameter to include the Gow root directory, but adding an extra leading '/' won't work either because when there is another slash in the path (e.g. /logs), then it won't remove one of the leading slashes according to the POSIX path conversion rules.
//application\logs\
should to work in this way
the same, cannot use variable with forward slash
FWIW, I am using an XPath value as an argument. I managed to bypass the replacement by quoting the argument and adding a space before the forward slash: " /Product/Description"
FWIW, I am using an XPath value as an argument. I managed to bypass the replacement by quoting the argument and adding a space before the forward slash:
" /Product/Description"
Excellent! I was looking at having to radically rewrite all of my existing bash scripts that I use across both Linux and Windows platforms to use a totally different delimiter, but your little elegant trick makes it as easy as inserting a single space before all commands that use the forward slash. Thank you.
It seems like bash is searching through all arguments you give on the command line and prefixing anything that starts with
/
with Gow's own fake root directory. Personally i have not seen any real-world use for this "feature", though perhaps it is doing it so that shell script references to stuff like/etc
works. Unfortunately it makes pretty much all Windows command line tools unusable from the shell:As you can see, quoting or backslashing does not solve the problem. I would like some kind of switch to turn this behavior off, in particular for interactive shell (not in scripts).