2

When I run git-sh from my terminal it works fine. But I get the following warning.

bash: export: `--wait': not a valid identifier

What is this and how do I get rid of it?

  • I'd look for lines containing --wait in ~/.gitshrc because you've probably have an error in your configuration. – msw Sep 18 '13 at 11:34
2

Somewhere in that script is a line like

export VAR=$SOMETHING

and the value of the variable SOMETHING contains a space followed by --wait, e.g. $SOMETHING may be foo --wait or foo --wait=42. The bash builtin export thus receives two arguments, VAR=foo (a perfectly valid assignment) and --wait, which is not a valid variable name.

The fix is to use double quotes. Always use double quotes around variable substitutions. Either of these will do:

export VAR="$SOMETHING"
export "VAR=$SOMETHING"

To find which line is affected, run bash -x ./git-sh instead of ./git-sh, or set -x; . git-sh; set +x instead of . git-sh. The shell will print a trace of the lines it executes; look for the error in the trace.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.