Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell脚本可以';登录时启动时找不到其他文件(Debian Linux)_Linux_Shell_Raspberry Pi - Fatal编程技术网

Shell脚本可以';登录时启动时找不到其他文件(Debian Linux)

Shell脚本可以';登录时启动时找不到其他文件(Debian Linux),linux,shell,raspberry-pi,Linux,Shell,Raspberry Pi,因此,我有一个通过rc.local登录时启动的脚本。该脚本调用一些其他脚本来启动和运行。但是,控制台说找不到文件和/或目录。当我在登录后手动运行脚本时,它工作正常。我甚至尝试添加一个小延迟,以便知道系统已登录。你知道为什么会这样,怎么解决吗 如果我的回答有点模糊,很抱歉,但据我所知,脚本需要通过管理员权限运行。让我详细说明一下,当系统启动时,它运行一组特定的脚本,这在不同的发行版中是不同的。因此,我要检查~/.bashrc/etc/profile.d,最重要的是~/.bash\u登录。看看你能在

因此,我有一个通过rc.local登录时启动的脚本。该脚本调用一些其他脚本来启动和运行。但是,控制台说找不到文件和/或目录。当我在登录后手动运行脚本时,它工作正常。我甚至尝试添加一个小延迟,以便知道系统已登录。你知道为什么会这样,怎么解决吗

如果我的回答有点模糊,很抱歉,但据我所知,脚本需要通过管理员权限运行。让我详细说明一下,当系统启动时,它运行一组特定的脚本,这在不同的发行版中是不同的。因此,我要检查
~/.bashrc
/etc/profile.d
,最重要的是
~/.bash\u登录
。看看你能在那里做些什么。我个人在这里添加了它。
~/.config/autostart
运行良好。不要忘记创建一个
.desktop
文件

希望这有帮助