Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A better way to modify system files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A better way to modify system files
Authored by: thadman08 on Jan 21, '05 12:51:15PM
Rather than changing the behavior of a sytem-wide program, I find that it's easier to have my own script directory and copy system scripts in to that and make changes.

Machine:~ username$ mkdir ~/bin
# ADD export PATH=/Users/USERNAME/bin:${PATH} to ~/.bash_profile
Machine:~ username$ . ~/.bash_profile
Machine:~ username$ cp /usr/bin/apropos ~/bin/
Machine:~ username$ chmod u+w ~/bin/apropos
# Make the changes to ~/bin/apropos
This assumes that you're running BASH as your shell. Make sure you substitute your short username for USERNAME. Here's what the commands do.
  1. Make a 'bin' directory in your home directory. You can call it something else if you want.
  2. You want your new 'bin' folder to be searched when looking for programs to run, so it must be added to the $PATH variable.
  3. Look closely, there's a period before ~/.bash_profile. This tells the shell to read ~/.bash_profile again, rather than closing your terminal and starting it back up again.
  4. Copy the systems apropos script to your new directory
  5. Give yourself Write permission on the new copy
  6. Edit the file like the hint told you to
If you're running C-shell or Tcsh, you'll need to use setenv in your .tcsrc or .login file.
Use this new directory for any command-line tricks and tips. It makes life so much easier and you don't have to do anything as a the superuser.

[ Reply to This | # ]