There are two errors. In short, this is the particular fix I would suggest (details follow):
Bad Hashbang Line
As Shutupsquare says, your hashbang line (technical details) should start with a
#! rather than just
That is causing the first of your two error messages, and will prevent your script from being run as
./run.sh, but is not the reason your script is failing to run
AptanaStudio3 (because the hashbang line is not required for
sh run.sh calling syntax).
By the way, when you run
sh run.sh, it runs your script with
sh as the interpreter. But with the hashbang line
./run.sh would run your script with
bash as the interpreter. This script does not in any way depend on the advanced features of
bash, and while
bash's additional memory usage is almost certainly insignificant for this application, you may still wish to write the hashbang line so
./run.sh runs the script with
Incorrect Use of
The main problem, which is causing your second error message and is the reason
AptanaStudio3 fails to run, is that you're using
export incorrectly. The
export command does not run commands. So your command is being interpreted as an environment variable itself.
export does not accept
NAME=value command or
NAME command syntax, however.
Assuming your goal is to run the command
/home/andrea/Programmi/Aptana_Studio_3/AptanaStudio3 with the
UBUNTU_MENUPROXY variable defined and set to
0, you should just drop the word
That is the standard way to run a command with a modified environment, from a shell.
The purpose of
export is to export variables into the environments of all subsequently launched child processes (i.e., every command run from your script). So running
export UBUNTU_MENUPROXY=0 on its own line followed by the
AptanaStudio3 command, as Shutupsquare suggests, will work, and have the same effect, and is a perfectly good and acceptable way to do it.
I prefer the way I've suggested above (without
- Semantically, your goal is not to export anything, but rather to run a single command with a modified environment. Using
export may cause confusion to others reading your script (or to yourself later), and as a secondary consideration is arguably less elegant.
export, you need two commands; using the way without it, you need only one.
Optional reading: the
env command works (sort of) the way you were trying to use
Finally, there is a command that accepts
NAME=value command syntax. This command is
env. There's no reason to use it in this shell script--its function, in that basic usage, is to provide (part of) the power of a shell in running a command with a modified environment, and you already have that power.
However, under some circumstances, outside of shell scripting, you may find you need to set an environment variable for a command and run that command (and do those things in a single command). In contexts where just using the line
VARIABLE=value command is not supported, you can use:
env VARIABLE=value command
You don't need that here though. All Bourne-style shells (e.g.,