Start background process from .bashrc

后端 未结 3 1020
遥遥无期
遥遥无期 2021-01-03 06:35

I realize that this might be a stupid issue but I can\'t solve it for hours even if digged stackoverflow site and google throughly.

Here is the base code in .bashrc

3条回答
  •  清歌不尽
    2021-01-03 07:04

    Almost forgot about this issue and answering my own question after found a working solution long ago ;) Follow works great in my .bashrc for years

    mygkrellm()
    {
        if pidof -x "gkrellm" >/dev/null; then
        echo "Gkrellm is already running. Go to shell!"       
        else
        nohup "/usr/bin/gkrellm" &
        fi
    }
    

提交回复
热议问题