我在 .bashrc 文件上有别名,例如;
alias modemreboot="IP=$(/sbin/ip route | awk '/default/ { print $3 }');echo "reboot" | sshpass -p "12345" ssh admin@$IP"
用于通过命令行重新启动我的调制解调器。当我键入或复制并粘贴到终端时,它可以工作,但是作为别名,我收到此错误;
Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh: Could not resolve hostname : Name or service not known