Wednesday, June 29, 2005

Bourne Shell redirect stderror

3. ^^ How do I redirect stderr?
1. Bourne Shell
1. to stdout
1. command 2>&1
2. to file
1. command 2> file
3. to null
1. command 2> /dev/null
2. C Shell
1. to stdout
1. command >& /dev/tty
2. to file (without affecting stdout)
1. ( command > /dev/tty ) >& file
3. to null (without affecting stdout)
1. a. ( command > /dev/tty ) >& /dev/null

4. ^^ How do I rename files by extension like MS-DOS?
1. DOS Example: move *.doc *.txt
2. Korn Shell
1. for x in *.doc; do mv $x ${x%.doc}.txt; done

0 Comments:

Post a Comment

<< Home