Saturday, June 12, 2010

io redirection

1. writing stderr and stdout seperately
make 1>a.out 2>b.out

2. only get the stdout
make > tmp.out

3. only get the stderr
make > tmp.out 3>&2 2>&1 1>&3 (3 is a descriptor for holding place)

4. put both to files
make > tmp.out 2>&1

& is used when both the src & dest are descriptors

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.