Re: .bash_profile: line execution based on su vs. direct login. [SOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



and the answer is...
-----
bash.1[~]: cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH

# If there are no xeyes already running, then...
if ! pgrep xeyes > /dev/null ; then
   # put one pair of xeyes in the upper right corner of the left monitor...
   /usr/bin/xeyes -geometry 1000x150+1559+0 -fg black -center pink \
                  -outline black &
   # and one pair of xeyes in the upper left corner of the right monitor.
   /usr/bin/xeyes -geometry 1000x150+2560+0 -fg white -center black \
                  -outline red &
fi

# the end.
bash.2[~]:
-----
... and that's my final answer (I hope!).  It works whether both users are regular users or one user is root.

(regarding Patrick's, Ed's, Todd's, and Samuel's "pidof" suggestion)
I tried that too, after getting the above script done and tested. It does work.  I did mis-understand the -c option.  But I think the main problem was I was using the quotes and square brackets in the if line.

(Ed's question about mis-typing the single quote)
I used the key between the semi-colon key and the "enter" key, not the key above the "tab" key.  (Now I know that both were wrong!)

Apart from binders, functors, and functional programming, I'm an excellent C++ programmer.  But I've done hardly any shell script programming.  I did not know the meaning and use of the double quotes and the square brackets in the if line.  This is what caused me so much trouble in my experimenting.

I'm tagging this thread SOLVED.  I thank everyone who tried to help.
Bill.
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux