执行脚本出现 standard in must be a tty

简介: 出现该提示是因为你执行的脚本的时候并不是在没有对应用户的环境变量,应该在脚本中加入su - username,来加载环境变量。

出现该提示是因为你执行的脚本的时候并不是在没有对应用户的环境变量,应该在脚本中加入su - username,来加载环境变量。可通过echo  $PATH 来查看会否切换成功。


----------------------------------update 2021年2月10日15:56:42


什么是TTY呢?

TTY 这个概念是一个历史的概念,过去用来传递信息,现在已经被传真、邮件、微信等取代。

目录
相关文章
|
Shell Linux
Centos7:“Entering emergency mode. Exit the shell to continue”错误解决方法
想过很多朋友有遇到这种情况,就是正在远程使用centos7系统时,一旦让远程虚拟机或服务器断电或强制关机,那么再次重启时就会出现“Entering emergency mode. Exit the shell to continue.”的错误。
11044 1
Centos7:“Entering emergency mode. Exit the shell to continue”错误解决方法
|
Shell Linux
Shell /dev/null 文件的含义
Shell /dev/null 文件的含义
56 0
|
Shell PHP Windows
php交互式命令行工具window操作系统安装readline扩展函数实现interactive mode enabled到Interactive Shell
php交互式命令行工具window操作系统安装readline扩展函数实现interactive mode enabled到Interactive Shell
83 0
|
移动开发 Unix Shell
执行shell脚本时提示bad interpreter:No such file or directory的解决办法
执行shell脚本时提示bad interpreter:No such file or directory的解决办法
1211 0
|
Shell 测试技术 Linux
Linux Shell : Test命令参数解析
格式: test conditions test -n string : string 不为空 test -z string : string 为空 test int1 -eq int2  : int1 == int 2test int1 -ne int2  : int1 != int2 te...
969 0