1

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

#echo "[+] Creating $count files" 
_remount 
create=$((time ./dirtest $testdir $count $size) 2>&1) 
Community
  • 1
  • 1
Anders Lind
  • 4,542
  • 8
  • 46
  • 59
  • 3
    From [this question](http://stackoverflow.com/questions/818255/in-the-bash-shell-what-is-21), it's a redirect of stderr to stdout. – simont Apr 14 '12 at 17:29

2 Answers2

4

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.

Óscar López
  • 232,561
  • 37
  • 312
  • 386
2

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

Karoly Horvath
  • 94,607
  • 11
  • 117
  • 176