stty:标准输入:设备的不适当的ioctl [英] stty: standard input: Inappropriate ioctl for device

查看:116
本文介绍了stty:标准输入:设备的不适当的ioctl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

perl script.pl --f1="t1" --f2="t2" --f3="t4" --f4 < /home/joe/a.txt 

script.pl

script.pl

use Getopt::Long;
my ($f1, $f2, $f3, $f4) ;
GetOptions (
            'f1=s' => \$f1,
            'f2=s' => \$f2,
            'f3=s' => \$f3,
            'f4' => \$f4, );
if ($f1) {
    system('stty -echo');
    print "Password:";
    $pwd = <STDIN>;
    system('stty echo');
}

我收到此错误:

stty: standard input: Inappropriate ioctl for device
Password:stty: standard input: Inappropriate ioctl for device

这是什么错误?我该如何解决?

What is this error? How do I resolve it?

推荐答案

我认为问题是您正在从重定向的STDIN中读取(因为您< file.txt)

I think the problem is you are reading from a redirected STDIN (because you <file.txt)

$ perl -e 'system("stty -echo");' </tmp/foo
stty: standard input: Inappropriate ioctl for device

您可能应该将文件作为参数传递给脚本.

You should probably pass your file as a parameter to your script.

这篇关于stty:标准输入:设备的不适当的ioctl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆