Everything2
Near Matches
Ignore Exact
Full Text
Everything2

My quick GPL'd script to adjust some PATH environment variables

created by mirko

(idea) by mirko (1.2 wk) (print)   ?   (I like it!) Wed Jan 24 2001 at 11:07:04

  1. Save the following shell script as mkpath.pl :
    #!/bin/sh
    
    find / -type d 2>/dev/null | grep -vi packages | grep -vi patches | grep -v "/tmp/" | sort | uniq | awk -F/ '
            BEGIN   {
                            path = "";
                            ldpath = "";
                            libpath = "";
                            manpath = "";
                    }
                    {
                            if (( $NF == "bin" ) || ( $NF == "sbin" )) {
                                    path = path ":" $0;
                            } else if ( $NF == "lib" ) {
                                    ldpath = ldpath ":" $0;
                                    libpath = libpath ":" $0;
                            } else if ( $NF == "man" ) {
                                    manpath = manpath ":" $0;
                            }
                    }
            END     {
                            print "export PATH=$PATH"path;
                            print "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"ldpath;
                            print "export LIBPATH=$LIBPATH"libpath;
                            print "export MANPATH=$MANPATH"manpath;
                    }'
    
  2. Don't forget to chmod it to -rwxr-xr-x
  3. Redirect it to your .bashrc like this : ./mkpath.pl >> ~/.bashrc
  4. Edit it to fit your needs.
  5. Logout, then Logon again and enjoy.
NB: Don't use it on a Solaris machine as this would generate a really long damn' PATH which would be too long to clean up that you'd have lost more time that saved with this script.

printable version
chaos

My GPL'ed octal-free chmod.pl E2 GNU Project Tips for using GNU Emacs in MS Windows POSIX_ME_HARDER
I don't think she even knows that I make her smile Euthanasia Semaphore GMWB
The Linux Directory Structure Solaris 1784 Weekwam
Magga random number generator One Teach Yourself Scheme: 11.3 Environment variables
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Look at this mess the Death Borg made!
With all the advances in technology it still takes 3 days to clear a cheque
Dwight D. Eisenhower
Forgotten things in space
Great Depression
Playfair Cipher
Manfred von Richthofen
fake plastic anything
Abu Ghraib Prison abuse scandal
Food in the Middle Ages
We are using the machines to steal it all back again
The Grand Inquisitor
The Rise of Christianity
Charles Dickens
New Writeups
antigravpussy
One fly amonst many(person)
sam512
Moon Base Shackleton, 1978(fiction)
Pavlovna
toy boy(person)
XWiz
tear jerker(review)
Heitah
Anarchy is Order(idea)
jessicaj
July 26, 2008(dream)
Berek
ABBA(person)
devolution
k-hole(place)
Nadine_2
The Sound Of Madness(review)
Twin Eclipse
Conversations with God: An Uncommon Dialogue(idea)
SwimmingMonkey
Conversations with Fo Fo- the Loneliest dog in Purgatory(fiction)
locke baron
lynx(thing)
Simulacron3
Reality, Dimensions and the Natural Ontology(essay)
SubSane
Making Love to a 9-Foot Woman(person)
Ouzo
Thoughts(idea)
Everything 2 is brought to you by the letter C and The Everything Development Company