Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-profile compatibility with osx #3

Open
ealprr opened this issue May 28, 2018 · 3 comments
Open

git-profile compatibility with osx #3

ealprr opened this issue May 28, 2018 · 3 comments

Comments

@ealprr
Copy link

ealprr commented May 28, 2018

On osx, dot-profile seems broken:

$ dot profile add test
/Users/ealprr/.config/dotgit/bin/git-profile: line 38: local: `$arg;;
	        -*) >&2 echo dot:': not a valid identifier
/Users/ealprr/.config/dotgit/bin/git-profile: line 38: local: `$arg.; exit 3;;
	        *) plain=': not a valid identifier
/Users/ealprr/.config/dotgit/bin/git-profile: line 38: local: `$arg;;
	    esac;
	    i=1;
	done;
	while ': not a valid identifier
/Users/ealprr/.config/dotgit/bin/git-profile: line 38: local: `$arg;
	    i=1;
	done;
	eval set': not a valid identifier
/Users/ealprr/.config/dotgit/bin/git-profile: line 38: local: `
	EOF
    )': not a valid identifier
@Snaipe
Copy link
Owner

Snaipe commented May 28, 2018

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?

@Snaipe
Copy link
Owner

Snaipe commented May 28, 2018

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.

@ealprr
Copy link
Author

ealprr commented May 28, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants