-2

my .bash_profile looks this way : enter image description here

When I open my terminal I get this three lines :

-bash: export: Workbooks.app/Contents/SharedSupport/path-bin': not a valid identifier -bash: export:Workbooks.app/Contents/SharedSupport/path-bin': not a valid identifier -bash: export: Workbooks.app/Contents/SharedSupport/path-bin': not a valid identifier -bash: export:Workbooks.app/Contents/SharedSupport/path-bin': not a valid identifier

What should I remove from my .bash_profile to get rid of this ?

enter image description here

ahmed_LA
  • 17
  • 3
  • Have you tried [this?](https://stackoverflow.com/questions/51518406/bash-export-workbooks-app-contents-sharedsupport-path-bin-not-a-valid-iden) – shimo Jan 12 '20 at 12:09
  • 2
    Please don't post screen shots of text. See also https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors – tripleee Jan 12 '20 at 13:02

1 Answers1

2

There are multiple errors here, but the one you are asking about is because the space in Xamarin Workbooks needs to be escaped or quoted. See also When to wrap quotes around a shell variable?

The repeated fragments are certainly erroneous as well; the repeated code should only be present once. I'm guessing you ran some buggy installer multiple times, and it blindly added stuff which contained errors in the first place, and definitely should not be added again if it was already present. If you can identify this installer, maybe submit a bug report to its maintainer.

Hardcoding a complex PATH is also usually wrong. Generally, the correct behavior is to preserve your previous PATH, and only add a single additional directory before or after the old value, like

PATH=/new/stuff:$PATH

or

PATH=$PATH:/new/stuff

where /new/stuff is the added directory, and $PATH recalls the variable's previous value.

If something blindly overrides your locale settings programmatically, that's also a bug, and outright hostile if your real locale settings were correct and useful. Using LC_ALL is quite likely severe overkill in any event; if a particular application requires you to override a particular locale setting, it should only override the specific one(s) it needs, not everything. But really, even then, it has no business writing this stuff to your personal preferences.

The Conda fragment also contains an example of poor practice (some would call it an antipattern); see also Why is testing "$?" to see if a command succeeded or not, an anti-pattern?

export PATH should not be necessary at all, though specifying it needlessly is harmless per se, and removes the assumption that the shell's system-wide startup files have already exported it. Exporting the same variable multiple times in the same script is just silly, though.

tripleee
  • 175,061
  • 34
  • 275
  • 318