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 (4.9 d) (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!
Bill Finger
Cartoran Empire
Josephine Baker
gongfu cha
Nodeshell as a term has got to go
Darryl Strawberry
J2EE
LZ Waterloo
Confusing parable about fish
space
R.E.M. ordering breakfast at Denny's at 3 AM
Cypherpunk
One Flew Over the Cuckoo's Nest
New Writeups
LostPsion
"Shut the Fuck Up" Theaters(idea)
Vanish
The line between normal and not(place)
beatrice
You've been slowly taking me over for nearly a year, do you know that?(idea)
Berek
YouTube(thing)
shaogo
How to Pretend to Have a Job(idea)
hapax
Les Provinciales(review)
zoeb
The Scene(review)
aneurin
Telephone Numbers for drama purposes(idea)
Alnilamski
Cosmicopolis(fiction)
eien_meru
measure(idea)
Dreamvirus
pussy willow(thing)
czeano
Three "T"s(idea)
UncleM
Vantage Point 2: Fractal Thread Count(idea)
LostPsion
First Fiction: Night(fiction)
Lysander Peregrine
How to Pretend to Have a Job(idea)
This affordable entertainment brought to you by The Everything Development Company