Re: Running a Script- and debugging.

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

 



On 24Sep2009 15:57, Nifty Fedora Mitch <niftyfedora@xxxxxxxxxxxx> wrote:
| On Wed, Sep 23, 2009 at 09:19:26AM -0400, Jim wrote:
| >> Also 'odd' things can happen if '.' and strange places
| >> are in your PATH.   Are you running it as root via "su",
| >> as root via "su -", as root via "sudo" or as yourself.
| ....
| > Mitch you DID IT !!  su - instead of su
| 
| What portable tricks out there might be included in a script
| to test for a user that typed "su" when "su -" is
| required.   An initial version would simply present 
| a hint but not exit.

This is really the wrong thing to test.

What you want to test is that the environment is sufficient for the
script. Testing "which foo" for various required commands (like
ifconfig or whatever is needed). Checking that certain things are in the
$PATH (or, better, _putting_ them in the $PATH).

i.e. check specific required stuff, not a hand-waving "might I have been
invoked in some special way".
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

Sometimes the only solution is to find a new problem.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux