1 is stdout. 2 is stderr. Here is one way to remember this construct (altough it is not entirely accurate): at first, 2>1 may look like a good way to redirect stderr to stdout. However, it will actually be interpreted as "redirect stderr to a file named 1". & indicates that what follows is a file descriptor and not a filename. So the construct becomes: 2>&1.>& is shell syntax for "fold a file descriptor into another"
September 28, 2010
“ 2>&1 ”?
Subscribe to:
Posts (Atom)
Archive
Flickr
Now Playing
Fav Blog
-
-
-
比住院更讓人恐慌的,是出院:長照 3.0 如何接住每一個手足無措的家庭6 days ago
-
-
-
How to take care of your hair this winter8 years ago