|
|
#21 |
|
Prospect
Join Date: Mar 2007
Posts: 12
|
Editing .bash_profile
Here's the easiest way I can think of to edit a dotfile:
. The "~/" is probably superfluous as the shell's CWD (current working directory) should be your home directory when the shell launches. Note that the edited .bash_profile will help only if you're using bash. You may also want to edit .profile (for sh, ksh, zsh and bash [when there's no .bash_profile]) and .login (for csh and tcsh) if you plan on using other shells. For csh and tcsh, use the command 'setenv' rather than 'export'.There are some instances where bash/csh/tcsh will source .bashrc/.cshrc/.tcshrc rather than .bash_profile/.login/.login (such as when opening a terminal under X11; the difference is that a X11 terminal is not a "login shell", if you want to google why), so you may also want to edit .bashrc/.cshrc/.tcshrc. If you want or need '/usr/local/mysql/bin/' in the path available to GUI apps, add it to ~/.MacOSX/environment.plist. Don't forget to logout & login afterwards to get immediate results. I don't think "/usr/local/mysql/bin/:$PATH" will work in environment.plist; you'll need to enter the full, expanded path (type "echo $PATH" from a command line to get it). I haven't tested how this will interact with shell startup files or what other effects it will have on GUI apps. It should be fine as long as all the necessary directories are included in PATH. You can also configure the Finder to show dotfiles so you can open .bash_profile et al from the GUI. From a command line, type: `defaults write com.apple.finder AppleShowAllFiles TRUE`, then restart the Finder by ctrl-opt-clicking on its icon in the dock and clicking "reload". To hide dotfiles, do the same but type "FALSE" instead of "TRUE" (I believe "YES" and "NO" will work instead of "TRUE" and "FALSE"). There are some Applescript and Automator solutions to easily toggle showing/hiding dotfiles. The Unix learning curve mixed with a deadline is a recipe for frustration, assuredly. Given time to play, learning to use Unix can be quite a joy. |
|
|
|
|
|
#22 | |||||||||||||||||||||||
|
Triple-A Player
Join Date: Dec 2006
Posts: 239
|
Assuming TextWrangler has installed the command-line tools for you (the default scenario for most people), then this is the command that you should enter in Terminal.app: edit ~/.profile Which should open your .profile file in TextWrangler. Another possibility is to just fire up TextWrangler, and then navigate to File => Open Hidden…, and choose "All Files" under the "Enable:" popup menu at the top of the window. You should be able to then click on and open your .profile file. here’s an example PATH, which would find binaries from "hand-compiled" executables in /usr/local, Fink, MacPorts, and Developer Tools: Code:
export PATH=$PATH:/usr/local/bin:/usr/local/sbin:/sw/bin:/sw/sbin:/opt/bin:/opt/sbin:/Developer/Tools:/De veloper/Private Code:
export MANPATH=/usr/share/man:/usr/local/share/man:/sw/share/man:/opt/local/share/man
__________________
find / -iname *your\ base* -exec chown us:us {} \; Last edited by Alex Yeh; 12-05-2007 at 08:22 PM. |
|||||||||||||||||||||||
|
|
|
![]() |
|
|