I am encountering a strange problem with my 64bit Ubuntu - on the export command.
Basically, I have got a VM installation on Ubuntu on my Win7, and I am trying to pa
export
is a Bash builtin, echo
is an executable in your $PATH
. So export
is interpreted by Bash as is, without spawning a new process.
You need to get Bash to interpret your command, which you can pass as a string with the -c
option:
bash -c "export foo=bar; echo \$foo"
ALSO:
Each invocation of bash -c
starts with a fresh environment. So something like:
bash -c "export foo=bar"
bash -c "echo \$foo"
will not work. The second invocation does not remember foo
.
Instead, you need to chain commands separated by ;
in a single invocation of bash -c
:
bash -c "export foo=bar; echo \$foo"
Probably because it's trying to execute "export" as an external command, and it's a shell internal.
If you are using C shell -
setenv PATH $PATH":/home/tmp"
SHELL
is an environment variable, and so it's not the most reliable for what you're trying to figure out. If your tool is using a shell which doesn't set it, it will retain its old value.
Use ps
to figure out what's really going on.
change from bash to sh scripting, make my script work.
Follow These step to Remove " bash export command not found." Terminal open error fix>>>>>>
open terminal and type : root@someone:~# nano ~/.bashrc
After Loading nano: remove the all 'export PATH = ...........................' lines and press ctrl+o to save file and press ctrl+e to exit.
Now the Terminal opening error will be fixed.........