I am trying to set up a Git
alias which has to convert a backslash to a forward slash to pass it later to filter-branch
command (the need arises since I use Posh
and will pass DOS
based file path as a parameter).
So I have this alias:
echo-test = "!f() { path=$(echo $1 | tr '\\' '/'); echo $path; }; f"
But I get this error:
tr: warning: an unescaped backslash at end of string is not portable
I tried writing tr '\\\\' '/'
inside, thinking that Git
simply escapes the \
and bash
gets a single \
, but I get the same error.
Any ideas?