python – 使用ssh时在bash中缺少’read’提示符?

请告诉我,我遗漏了一些非常明显的东西:

$cat ~/bashplay/f
#!/bin/bash
read -p 'RDY> ' x
echo $x

$~/bashplay/f
RDY> direct execution
direct execution

$ssh somehost ~/bashplay/f
indirect via ssh
indirect via ssh

请注意缺少的“RDY>”使用ssh时提示.使用“readline”包时,我在python中看到了同样的东西.谁知道为什么?

解决方法:

来自man bash:

-p prompt
Display prompt on standard error, without a trailing new‐
line, before attempting to read any input. The prompt is
displayed only if input is coming from a terminal.

使用强制伪tty分配的ssh选项-t:

ssh -t somehost ~/bashplay/f

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...