Open ealprr opened 6 years ago
Interesting. This should be standard POSIX shell scripting, so I'm not sure what changes on OS X's /bin/sh.
I don't have an OS X machine handy right now, does their /bin/sh support local
in shell functions?
Oh, I stand corrected: local
was proposed for POSIX, but isn't currently part of the standard, so I would wager that this is the problem.
Honestly, I do not understand what is wrong here.
local
is available within bsd sh:
% sh
sh-3.2$ local i
sh: local: can only be used in a function
sh-3.2$ function test() { local i=0; i=$(($i+1)); echo "$i"; }
sh-3.2$ test
1
On osx,
dot-profile
seems broken: