我目前正在编写我的第三个Shell脚本,但遇到了问题。到目前为止,这是我的脚本: #!/bin/bash echo "choose one of the following options : \ 1) display all current users \ 2) list all files \ 3) show calendar \ 4) exit script" while read do case in 1) who;; 2) ls -a;; 3) cal;; 4) exit;; esac done 当我尝试运行脚本时,它说: line2 : unexpected EOF …
我在玩一个perl脚本,该脚本需要用户输入以下内容: system( qw( stty -echo ) ); $? == 0 or die "Error unable to disable character printing.\n"; print "$prompt: "; my $input = <STDIN>; 我以为我可以使用echo响应,但是似乎与stty -echo命令冲突并产生以下错误: stty: standard input: Inappropriate ioctl for device 在不更改perl脚本的情况下,可以在bash中完成传递输入的操作吗?是什么原因引起的问题?