Every time I open terminal it says:
bash: =: No such file or directory
What would cause this?
The problem was that I edited my `.bashrc file and added a source variable:
source = /etc/environment
Variable assignment in bash must be without spaces. Editing it to:
solved the problem
The error that you see has two main reasons for existence.
You have spaces between variable name and variable assignment. Proper sytax is to have
Your variable is named
source is actually a shell built-in command. Exactly because you had space between
= the first word in the line was considered a command by the shell.
$ bash -c 'source = "something"' bash: =: No such file or directory
bash built-in command , you see
bash mentioned in the error. Compare this for example with another command:
$ bash -c 'stat = "something"' stat: cannot stat '=': No such file or directory stat: cannot stat 'something': No such file or directory
Please note that the core of the issue is that line is interpreted as command with positional parameters given. It doesn't mean that variable name is incorrect and in fact you could use those variable names ( even though I'd say it's a poor practice to use names of variables similar to existing command names, but that's just my opinion):
$ bash -c 'stat="something";echo "$stat"' something $ bash -c 'source="something";echo "$source"' something