分页: 1 / 1

怎么让bash不报任何错误呢?[已解决]

发表于 : 2009-04-16 16:38
sanz
怎么让bash不显示任何错误呢?存储为一个变量中。是不是什么管道定向啊?不懂。

Re: 怎么让bash不报任何错误呢?

发表于 : 2009-04-16 17:17
hellojinjie
2 > /dev/null

Re: 怎么让bash不报任何错误呢?

发表于 : 2009-04-16 17:27
sanz
还是有红色的报错啊!不是BASH本身的报错,是程序的报错。

> /dev/null我知道的,那个前面的"2"是什么意思啊?

Re: 怎么让bash不报任何错误呢?

发表于 : 2009-04-16 18:01
pope123
同问

Re: 怎么让bash不报任何错误呢?

发表于 : 2009-04-17 5:56
sanz
虽然man中没有-b的选项,但是居然真有用。看样子这个参数是通用的

Re: 怎么让bash不报任何错误呢?[已解决]

发表于 : 2009-04-17 7:41
HuntXu
2是标准错误信息...当然有用...
:em26
However, there is much more to redirection than this simple example reveals. You’ll learn more about the
standard file descriptors in Chapter 3, but for now all you need to know is that file descriptor 0 is the standard
input to a program, file descriptor 1 is the standard output, and file descriptor 2 is the standard error
output. You can redirect each of these independently. In fact, you can also redirect other file descriptors, but
it’s unusual to want to redirect any other than the standard ones: 0, 1, and 2.

Re: 怎么让bash不报任何错误呢?[已解决]

发表于 : 2009-04-17 10:51
sanz
怎么用啊?

Re: 怎么让bash不报任何错误呢?[已解决]

发表于 : 2009-04-17 12:29
lerosua
不报错的话,有错也查不出,不好吧,呵呵