Skip to main content

Posts

Showing posts from April, 2005

nohup and redirection of standard input/output/error

NOHUP and Redirection of standard input/output/error Examples JMX_PORT=1234 nohup command </dev/null >logs/nohup.out 2>&1 & # Sets a variable only for command, redirects standard input from null (disables input), then redirects standard output to logs/nohup.out & finally redirects standard error to standard output JMX_PORT=1234; nohup command </dev/null >logs/nohup.out 2>&1 & # Sets the variable for current shell, redirects standard input from null (disables input), then redirects standard output to logs/nohup.out & finally redirects standard error to standard output nohup command >/dev/null 2>&1 & # First redirects standard output to null & then redirects standard error to standard output nohup command &> /dev/null & # Same as above, but only in BASH nohup command </dev/null >/dev/null 2>&1 & # Redirects standard input from null (disables input), then redirects standard output to null &