![在 ~/.profile 中调用脚本会停止我的登录](https://linux22.com/image/21089/%E5%9C%A8%20~%2F.profile%20%E4%B8%AD%E8%B0%83%E7%94%A8%E8%84%9A%E6%9C%AC%E4%BC%9A%E5%81%9C%E6%AD%A2%E6%88%91%E7%9A%84%E7%99%BB%E5%BD%95.png)
我在我的 .bashrc 文件中调用了 bash 脚本~/.profile
。
该脚本执行 CLI 程序以在登录时调暗我的屏幕。但是,运行脚本后,Gnome 不会继续让我登录到标准桌面。
有没有办法让~/.profile
脚本调用非阻塞?我很高兴提供更多细节来帮助您回答这个问题。我的发行版是 Linux Mint。
编辑
内容.profile.
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# Me
bash /home/eoin/repos/scripts/autostart.sh
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
我的脚本/home/eoin/repos/scripts/autostart.sh
:
#!/bin/bash
bash ~/repos/scripts/redshift/redshift.sh
这又调用另一个脚本:-P
#!/bin/bash
redshift -v
答案1
脚本的背景,即
# Me
bash /home/eoin/repos/scripts/autostart.sh &