Fix for issue 1 breaks on macos
mattmartini opened this issue · comments
The code used to correct issue #1 in env.bash
does not work on macos.
Specifically, expr index
causes a syntax error. The BSD version, which is the basis for the macos version, of expr
does not support length
, substr
, index
,or match
.
The second field can be found by taking the $line
and deleting everything upto ': '
This can be done like:
pwd=${line#*: }
I will be submitting a pull request to fix this issue.
Note: the first field can me found via:
key=${line%%:*}
This will not be changed in the PR.
Finally, as a side issue tr a-z A-Z
should be written tr "[:lower:]" "[:upper:]"
to properly capitalize.
I appreciate the detailed bug-report, and your pull-request looks like it does the right kind of thing.
I'll test it locally today, and if it continues to work for me will merge later this evening.
Thanks again!
Closed in #3.