“> /dev/null” will redirect STDOUT to a BLACK HOLE
“2 > &1” will redirect STDERR to STDOUT which in turn is redirected to a BLACK HOLE
it mean that>/dev/null 2>&1
is equivalent to
>/dev/null 2>/dev/null
-------------------------
I think that:1) “wibble > /dev/null 2>1″ stdout is redirected to /dev/null and stderr is redirected to a file named “1″ (in the current directory)
2) “wibble > /dev/null 2>&1″ stdout is redirected to /dev/null and stderr is redirected to where stdout is redirected (bit bucket)
3) “wibble > /dev/null &2>1″ stdout is redirected to /dev/null , then character “&” comes, which means that this process will run in background(parallel with the shell u are using). Then comes 2>1 which will create an empt file with the name 1.
And FINALLY!!!
4) “wibble > /dev/null &2>&1 ” stdout is redirected to /dev/null. “&” means that, that process(wibble) will run in background(with stdout redirected only).Then another process is started with 2>&1 which creates no file.
沒有留言:
張貼留言