Re: Running a Script- and debugging.

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

 



On Thu, Sep 24, 2009 at 3:57 PM, Nifty Fedora Mitch
<[email protected]> 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
>
> Glad to hear it..
>
> OK gang out there.
>
> 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.
_____

I'm thinking some incantation involving the environment variables.
For example, executing this
       $ env | egrep -w "$USER|$PWD|$HOME|$LOGNAME|$PATH"
provides clues as to what has changed when "su" or "su -" is used.

maybe hard-code the script path and see whether it's included in the
$PATH env variable perhaps use awk to parse).

~af

-- 
fedora-list mailing list
[email protected]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux