Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 01-17-2004, 05:54 PM   #1
gsdali
Triple-A Player
 
Join Date: Nov 2002
Posts: 136
Adding new commands

I recently installed the ncurses aim client pork. I didn't pay attention to the INSTALL manual and it installed in in /usr/local/bin/ rather than uninstall in and reinstall in in /sw/bin/. How do I add a comand so I can launch pork by typing pork rather than /usr/local/bin/pork.

Thanks in advance.
__________________
--
Ed Lynch-Bell
gsdali is offline   Reply With Quote
Old 01-17-2004, 06:44 PM   #2
naum
Prospect
 
Join Date: Jul 2003
Posts: 24
If you're running bash, add this line (or modify as needed...) to your $HOME/.bash_profile:

export PATH=$PATH:/usr/local/bin

Similar statement for tcsh but I'm not a csh-er so consult your friendly man pages...
naum is offline   Reply With Quote
Old 01-17-2004, 07:00 PM   #3
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
In tcsh, create a .login file in your home directory and put in something to the effect of:
Code:
setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:"
Which is the basic path + /usr/local/bin, next time you open an terminal window it'll set your path automatically. In the meantime, you can type:
Code:
source ~/.login
and your path will immediately be set to what is in your .login in the window you sourced it in.

Last edited by yellow; 01-17-2004 at 07:02 PM.
yellow is offline   Reply With Quote
Old 01-17-2004, 07:12 PM   #4
gsdali
Triple-A Player
 
Join Date: Nov 2002
Posts: 136
how do I do that for all users? By the way I'm using tcsh not bash it that helps.

Also why shouldn't I add

Code:
setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:"
to my .tcshrc file?
__________________
--
Ed Lynch-Bell

Last edited by gsdali; 01-17-2004 at 07:16 PM.
gsdali is offline   Reply With Quote
Old 01-17-2004, 07:30 PM   #5
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
There is a reason, I just cannot come up with it right now. Traditionally, that goes into the .login, I'm sure there's a valid reason for it.

For all users, add it to the /etc/csh.login
yellow is offline   Reply With Quote
Old 01-17-2004, 08:08 PM   #6
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Quote:
Originally posted by gsdali
...Also why shouldn't I add

Code:
setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:"
to my .tcshrc file?

because the .tcshrc file is also read/loaded for subshells. subshells inherit environment from the parent shell, so it is undesirable to reset the path for subshells.

e.g., if you augment the path in the shell's rc file:

setenv PATH "${HOME} $PATH"

the result would be to prepend the value of $HOME for each subshell. certainly not what is wanted.

the shell's login file is read once for each login (window) in the terminal.app
mervTormel is offline   Reply With Quote
Old 01-17-2004, 09:37 PM   #7
gsdali
Triple-A Player
 
Join Date: Nov 2002
Posts: 136
ta very much.

I really ought to sit down and dig deeper into thew hows and whys of some of this stuff. Anyone recommend a good book/primer site?
__________________
--
Ed Lynch-Bell
gsdali is offline   Reply With Quote
Old 01-19-2004, 04:55 PM   #8
gsdali
Triple-A Player
 
Join Date: Nov 2002
Posts: 136
I appear to have hosed all of my fink commands. I can't launch a single fink installed application now. I tried reinstating things as the were. the applications installed in /usr/local/bin work. When I run setenv, the path line reads:

Code:
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:
How do I add my fink paths to this?
__________________
--
Ed Lynch-Bell
gsdali is offline   Reply With Quote
Old 01-19-2004, 05:10 PM   #9
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
basic fink installation instructions state to put the following in your login startup, after path is defined...
Code:
source /sw/bin/init.csh
mervTormel is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 06:06 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.