将 Node.js Grunt 作业发送到后台
Sending a Node.js Grunt job to background
通常在终端中的命令末尾附加 &
会隐藏 output/redirect 命令的标准输出。
我知道我可以启动一个 tmux 会话来实现相同的目标(即隐藏输出,并使用相同的终端 window 来执行更多命令)但我很好奇为什么 webpack 的服务器会看似将作业发送到后台,然后几秒钟后,不再这样做。
我查看了 man bash
并找到了这个,但它仍然没有完全回答我的问题(none 我使用重定向运算符的其他脚本的行为是这样的)
Redirecting Standard Output and Standard Error
Bash allows both the standard output (file descriptor 1) and the standard error output (file
descriptor 2) to be redirected to the file whose name is the expansion of word with this con-
struct.
There are two formats for redirecting standard output and standard error:
&>word
and
>&word
Of the two forms, the first is preferred. This is semantically equivalent to
>word 2>&1
试试这个:
nohup grunt serve &
通常在终端中的命令末尾附加 &
会隐藏 output/redirect 命令的标准输出。
我知道我可以启动一个 tmux 会话来实现相同的目标(即隐藏输出,并使用相同的终端 window 来执行更多命令)但我很好奇为什么 webpack 的服务器会看似将作业发送到后台,然后几秒钟后,不再这样做。
我查看了 man bash
并找到了这个,但它仍然没有完全回答我的问题(none 我使用重定向运算符的其他脚本的行为是这样的)
Redirecting Standard Output and Standard Error
Bash allows both the standard output (file descriptor 1) and the standard error output (file
descriptor 2) to be redirected to the file whose name is the expansion of word with this con-
struct.
There are two formats for redirecting standard output and standard error:
&>word
and
>&word
Of the two forms, the first is preferred. This is semantically equivalent to
>word 2>&1
试试这个:
nohup grunt serve &