Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 非交互模式下的stty_Shell_Unix_Ssh_Stty - Fatal编程技术网

Shell 非交互模式下的stty

Shell 非交互模式下的stty,shell,unix,ssh,stty,Shell,Unix,Ssh,Stty,我正在通过远程服务器中的脚本执行命令,该脚本是非交互模式。我查看了链接,发现下面的错误是因为在非交互模式下运行stty。[URL=”http://compgroups.net/comp.unix.shell/stty-invalid-argument-using-ssh/506594“] stty-echo useradd-m 短回声 stty用于在终端中不显示密码。但是我越来越 stty:标准输入:参数无效 和输出一样 如何在我的输出中消除/克服此错误。echo用于确定屏幕上是否显示本地键入

我正在通过远程服务器中的脚本执行命令,该脚本是非交互模式。我查看了链接,发现下面的错误是因为在非交互模式下运行stty。[URL=”http://compgroups.net/comp.unix.shell/stty-invalid-argument-using-ssh/506594“]

stty-echo
useradd-m
短回声
stty用于在终端中不显示密码。但是我越来越 stty:标准输入:参数无效 和输出一样


如何在我的输出中消除/克服此错误。

echo
用于确定屏幕上是否显示本地键入的字符(据我所知)

我不认为这对已经包含密码的脚本有任何作用

因此,您可以完全删除这两行
stty
,因为它们一开始对您没有任何用处


或者,如果出于某种原因,有(或您认为有)理由保留这些行,您应该能够向这些命令添加
2>/dev/null
,以使错误输出静音。

stty
在非交互式脚本中工作良好。这是一个未连接到控制tty的脚本(交互式或非交互式),该tty将出现
stty
问题。非交互不一定等同于“无控制tty”。。。
stty -echo 
useradd <useraname> -m <password>
stty echo