What does "2>&1" here mean?

Possible Duplicate:
In the bash shell, what is “ 2>&1 ”?

#echo "[+] Creating $count files" 
_remount 
create=$((time ./dirtest $testdir $count $size) 2>&1) 

It means that the standard error descriptor stderr (2) is to be redirected to the standard output descriptor stdout (1). Notice that the & ensures that the 1 is interpreted as a file descriptor and not a filename.


It redirects standard error to the standard output. This way the result written to stderr will be stored in the variable.

链接地址: http://www.djcxy.com/p/25582.html

上一篇: bash中“1&2”是什么意思?

下一篇: 这里“2>&1”是什么意思?