Nohup command on a script that accepts all parameters

I try to run a script with nohup, but the command executes a whole line of parameters with the variable $ *. I am trying to run a command as follows:

nohup time ./build_all all & 

But this gives me the following error in nohup.out:

 ./build_all: DISPLAY=ted:0.0: is not an identifier 

Any help was appreciated.

Ted

==================================================== ==================================

I understand that Peter John Aklam was right. The error is not due to nohup, but because of the script, I am not sure what I am doing wrong, because the syntax seems to me to be correct. It’s also strange that when I run the script on its own, I don’t see an error, but when I try to run with nohup, I see a strange error.

In any case, the start of the script looks like this:

 #!/bin/bash export DISPLAY=ted:0.0 # sets the display export RELEASE=v1.0 node=`uname -n` 
+6
source share
2 answers

Just put the arguments in "build_all" on the command line, as with any other command:

 nohup time ./build_all args to build_all go here & 

and the arguments will be passed to "build_all", not "time" or "nohup". Ampersand will be correctly interpreted by the shell and will not be passed as an argument to any of the commands.

+6
source

The arguments (parameters) of the script simply follow the name of the script and precede the ampersand.

+1
source

Source: https://habr.com/ru/post/901615/


All Articles