I need to export an environmental variable to run a program. I am able to successfully do that in interactive mode. However, when I try to export an environmental variable as part of a bash shell script, I get this error message:
export: Command not found.
In interactive mode, when I type in the following command, it works.
export GT_DIR=/cluster/home/SD/
But when I include the export command as part of the shell script, it does not work. I.e.,
#!/bin/bash
export GT_DIR=/cluster/home/SD/
I get the error message:
export: Command not found.
When I type in echo $SHELL
, I get
/bin/bash
Why is the export command working in interactive mode but not when I try to submit it as a script?
source somethingthatexportsvariables
so the command is run within the current process. running a different script will only change the environment in that script, which then exits. – thrig Nov 23 '18 at 21:46export: Command not found.
is exactly the error message that acsh
outputs. – Cyrus Nov 23 '18 at 21:52