[NCLUG] Why not Root?

James DeWitt jdewitt at verinet.com
Sat Mar 17 17:16:01 MDT 2007


Hi Jeff,

pathmunge is a simple function that seems to have been a default 
part of  /etc/profile in Fedora/Redhat for many years.  


pathmunge () {
        if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
           if [ "$2" = "after" ] ; then
              PATH=$PATH:$1
           else
              PATH=$1:$PATH
           fi
        fi
}

Cheers,
JD

On Saturday 17 March 2007 4:39:25 pm Jeffrey D. Means wrote:
> James, you mention pathmunge as a fix for your /etc/profile but I can't
> find pathmunge on my system.  Is it a package I can download or a script
> you wrote?
>
> Thanks,
> Jeff Means
>
> On Sat, 2007-03-17 at 13:48 -0600, James DeWitt wrote:
> <Snip>
>
> > Yes, this is a pain. By default, fedora excludes the sbins
> > from regular user PATHs, so sudo can't find things either.
> > I fix this in /etc/profile - just comment out the if/fi lines
> >
> >     # Path manipulation
> >     #if [ "$EUID" = "0" ]; then
> >         pathmunge /sbin
> >         pathmunge /usr/sbin
> >         pathmunge /usr/local/sbin
> >     #fi
>
> </End snip>





More information about the NCLUG mailing list