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?

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

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .