我试图从远程机器grep的Oracle金色门,但随着版本它也给出了一些错误的细节,我该如何解决?
user@serverhost:/dbei > echo <golgengate install path>/ggsci | ssh gger@payhlc203 | grep "Version" Pseudo-terminal will not be allocated because stdin is not a terminal. stty: standard input: Invalid argument Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
使用-T选项来ssh;
-T禁用伪tty分配。
从manpage。
即使您禁用伪tty分配( -T选项),您仍可能会收到Invalid argument错误。
看起来ggsci是一个交互式程序,需要一些input。 你可以尝试这样的:
echo | ssh gger@payhlc203 /path/to/goldengate/ggsci | grep Version
如果不这样做,你总是可以通过redirectstderr来摆脱多余的输出,例如:
echo | ssh gger@payhlc203 /path/to/goldengate/ggsci 2>/dev/null | grep Version