小问题,但很烦人:有没有办法避免每次查询时出现以下消息:
-- Loading resources from /Users/ThG/.sqliterc
最佳答案
作为一个愚蠢的解决方法,这个有效:
<. sqlite your_sqlite.db 'select * from your_table'
这是因为 current code这样做:
if( stdin_is_interactive ){
utf8_printf(stderr,"-- Loading resources from %s\n",sqliterc);
}
由于 this piece of code,强制标准输入重定向会阻止此操作:
stdin_is_interactive = isatty(0);
这也适用:
sqlite -batch your_sqlite.db 'select * from your_table'
}else if( strcmp(z,"-batch")==0 ){
/* Need to check for batch mode here to so we can avoid printing
** informational messages (like from process_sqliterc) before
** we do the actual processing of arguments later in a second pass.
*/
stdin_is_interactive = 0;
}
但它更长,所以有点违背了目的。
关于sqlite - 避免消息 "-- Loading resources from .sqliterc",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4174897/