I'm still struggling to understand why invoking the script the way
that I do would in any way entail lookups on the network. I'm just
passing a string, containing a network address, verbatim to a script
and assigning it verbatim to a variable.
However, some of what I reported earlier turned out to be incorrect or
inaccurate
> This specific script isn't really relevant, the issue can be reproduced using
>
> ```git-slow.sh
> #!/bin/bash
> echo "$1"
> ```
Most importantly, this was incorrect. The issue only presents itself
when the shebang is #!/bin/sh and _not_ #!/bin/bash
Ie, it should say
> ```git-slow.sh
> #!/bin/sh
> echo "$1"
> ```
Another thing that turned out to be incorrect was
> This usually runs without problem, except in the odd situation that
> it's invoked via git, with a shell quoted variable that contains a
> network path
> For example
> git slow.sh a
> git slow.sh '\\8.8.8.8\foo\bar\'
> a='\\8.8.8.8\foo\bar'
> git-slow.sh "$a"
> all run fine
Specifically
> git slow.sh '\\8.8.8.8\foo\bar\'
turned out to also be affected but it appears the lookup that occurs
is cached. Ie. running
git slow.sh '\\8.8.8.8\'
will be slow the first time around but subsequent invocations will run
a lot faster, for a while, presumably until the lookup is no longer
cached.
Another noteworthy addendum to the issue is that invoking
git slow.sh '\\123\'
in cmd does _not_ result in the same issue.
All of this points to some sort of issue in the interplay of bash, git
and sh (whichI believe is bash running in POSIX mode?)
Since changing the shebang resolved my issue, I will opt for this solution.