Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ep4 `sort -n` has different behaviour on Mac and git bash vs linux #810
changed the title from
Ep4 sort -n exercise doesn't work on Mac or git bash
Ep4 `sort -n` has different behaviour on Mac and git bash Vs linux
Jul 3, 2018
The example in question uses the
On Git Bash:
Can anyone help me understand what is going on here?
I'm not sure I understand - are you suggesting that
I wondered whether this was something to do with locale.
The same in git bash gives:
(again, no aliases set on sort).
Not sure if that helps, or just adds to the confusion. I'm not sure what else to try, in order to try and work out what's going on.
I get the same output on git bash whether I used
Doing some further digging, the callout example in the lesson:
Does work as expected on git Bash (regardless of
What I think is happening is that with
Where space sorts low you'll get an apparently numeric sort, even if the sort command is sorting by character.
In terms of episode 4, this all means that the call-out behaves as expected, but asking learners to compare the output of:
(as I did in the carpentry course on Monday) is system dependent because of the leading spaces in the output of