在带有所有参数的脚本上运行nohup命令

Fle*_*seo 6 bash nohup

我正在尝试使用nohup运行脚本,但该命令恰好采用变量$*的整行参数.我尝试运行这样的命令:

    nohup time ./build_all all &
Run Code Online (Sandbox Code Playgroud)

但这在nohup.out中给了我以下错误:

./build_all: DISPLAY=ted:0.0: is not an identifier
Run Code Online (Sandbox Code Playgroud)

任何帮助赞赏.

摊晒

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

我意识到Peter John Acklam是对的.错误不是因为nohup,而是因为脚本,我不确定我做错了什么,因为语法似乎对我来说是正确的.当我自己运行脚本时,我没有看到错误,但是当我尝试使用nohup运行时,我看到了奇怪的错误,这也有点奇怪.

无论如何,脚本的开头看起来像这样:

#!/bin/bash

export DISPLAY=ted:0.0 # sets the display
export RELEASE=v1.0

node=`uname -n`
Run Code Online (Sandbox Code Playgroud)

Pet*_*lam 7

只需将参数放在命令行中的"build_all",就像任何其他命令一样:

nohup time ./build_all args to build_all go here &
Run Code Online (Sandbox Code Playgroud)

并且参数将传递给"build_all",而不是"time"或"nohup".&符将由shell正确解释,并且不会作为参数传递给任何命令.