小编CJ *_*cio的帖子

有没有办法配置 sqlplus 将错误输出到 STDERR 而不是 STDOUT?

如果我通过管道传输此脚本:

me:~/git/my-project$ find . -type f -not -path '*bin*' -name '*ignored*sql' -exec cat {} \;
dsadadasda SELECT * FROM some_table;
Run Code Online (Sandbox Code Playgroud)

变成sqlplus这样:

me:~/git/my-project$ find . -type f -not -path '*bin*' -name '*ignored*sql' -exec cat {} \; | sqlplus $my_connection_string | grep -i unknown
SQL> SP2-0734: unknown command beginning "dsadadasda..." - rest of line ignored.
Run Code Online (Sandbox Code Playgroud)

然后错误进入STDOUT而不是STDERR

me:~/git/my-project$ find . -type f -not -path '*bin*' -name '*ignored*sql' -exec cat {} \; | sqlplus $my_connection_string 1>/dev/null
me:~/git/my-project$
Run Code Online (Sandbox Code Playgroud)

有什么方法可以配置 …

linux oracle sqlplus

6
推荐指数
1
解决办法
278
查看次数

标签 统计

linux ×1

oracle ×1

sqlplus ×1