perl script.pl --f1="t1" --f2="t2" --f3="t4" --f4 < /home/joe/a.txt
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
linux迭代目录中的文件
不扩展$ HOME或“〜”的符号链接?
当redirect到文件时,bash – 标准输出文本会被截断
如何用bash脚本打印string“value”! 命令
拿到连接的设备列表
在shell脚本中使用cd和cd命令是另一个目录中的一些计算的好方法
从bash运行csh脚本,通过命令更改shell临时文件
用命令或命令在两个目录中find文件的顺序
我认为问题在于你正在从重定向的STDIN中读取(因为你<file.txt)
$ perl -e 'system("stty -echo");' </tmp/foo stty: standard input: Inappropriate ioctl for device
你应该把你的文件作为参数传递给你的脚本。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。