(I'm editing an existing Bash script, so I'm probably making a silly mistake here...)
I have a shell script that saves a command with an environment variable as its argument like this:
COMMAND="mvn clean install -P $MAVEN_PROFILE"
It then executes the command with nohup
roughly as follows:
nohup $COMMAND > logfile
This works.
Now, I want to set an environment variable that can be accessed in Maven. I've tried several things like the following:
COMMAND="FORMAVEN=valueForMaven mvn clean install -P $MAVEN_PROFILE"
...but then it just terminates with:
nohup: failed to run command `FORMAVEN=valueForMaven': No such file or directory
I feel like there are several unrelated concepts at work here, none of which I understand or even know about. What do I need to be able to do the above?