Two methods to redirect output for “set -x”

I found that the standard direct cannot redirect the output of the “set -x”, following is two methods to redirect output for “set -x” by google and my co-worker:

1: ./test.sh > test.log 2>&1

2: test.sh 2>&1 | tee -a test.log

About “tee” from linux man page:

Name
tee – read from standard input and write to standard output and files
Synopsis
tee [OPTION]… [FILE]…
Description

Copy standard input to each FILE, and also to standard output.
-a, –append
append to the given FILEs, do not overwrite
-i, –ignore-interrupts
ignore interrupt signals
–help
display this help and exit
–version
output version information and exit
If a FILE is -, copy again to standard output.
Author
Written by Mike Parker, Richard M. Stallman, and David MacKenzie.
Reporting Bugs
Report bugs to .
Copyright
Copyright � 2006 Free Software Foundation, Inc.This is free software. You may redistribute copies of it under the terms of the GNU General Public License . There is NO WARRANTY, to the extent permitted by law.
See Also
The full documentation for tee is maintained as a Texinfo manual. If the info and tee programs are properly installed at your site, the command
info tee
should give you access to the complete manual.
Referenced By
auto-build(1), pee(1), tee(2), tpipe(1)

Posted by 52nlp

Related posts:

  1. Error “join: multi-character tab `\\t’” for using join tab
  2. “Nohup” and “Screen”
  3. Moses Support Digest: Note that regr. test for ptable-filtering fails
  4. “set -x”: Prints executed commands and their arguments
  5. How to start new process or run shell commands within python?
  6. Moses Support Digest:CreateBerkeleyPt and On-Disk Rule Table
  7. Moses Support Digest: Moses seems to hang
  8. Moses Support Digest:moses threads compilation problem with RandLM
  9. Moses Support Digest:Binarized SRILM
  10. Moses Support Digest:Alignment information from binary phrase table
This entry was posted in Programming Skill and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>