Sample Header Ad - 728x90

Export commands works in interactive mode, but produces error message in script

0 votes
1 answer
412 views
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?
Asked by SD23Nov18 (5 rep)
Nov 23, 2018, 09:40 PM
Last activity: Nov 24, 2018, 06:20 PM