At 13:52 -0700 8/14/11, Govinda wrote:
>I really want to ask more questions here .. but perhaps BBedit users
>will (rightly) feel I am going too OT.  (Like WHY does it not work to
>just be in the right directory and type the name of a command?; why
>does the command have to have the './' first?  I guess I need to find
>a good CL forum and ask about what you meant Herb, when you referred
>to "PATH"?

Bare Bones really needs a special mailing list for BBedit worksheets.  Your 
questions would be fully appropriate there and I certainly recommend that you 
get into worksheets for your future travels into Terminal land.

When you start up a terminal session the shell "hashes" the commands it knows 
about. It looks at the current value of your $PATH environment variable, which 
is a colon separated list of directories in which it expects to find tools, and 
takes note of all of the executable files it finds.  It's that hash that is 
used when you type a command name.  The command, echo $PATH, tells all.

It's a relic of the days when building the hash was a slow thing to do and 
there was an advantage in doing it only once.  In the c-shell - Apple's 
favorite in their MPW shell of the classic OS - there is a rehash command that 
will ask the shell to repeat the task.

By providing a full path for an executable, as you do when you prepend ./ to a 
filename in the current directory you tell the shell exactly what to execute 
and the hash is ignored.

You can change the $PATH variable which is just another environment variable.  
In my $HOME/.tcshrc I add to the default path with this:

setenv PATH $HOME/bin:$PATH

which adds a directory "bin" that I keep in my home directory in front of the 
default.  It's also possible to add "." to your path which would include any 
current directory but that's considered a bad thing to do for reasons involving 
security.

And yes.  The c-shell is deprecated these days but I use MPW on my older Macs 
and I like to keep things more or less the same on OS neXt.  You can do 
everything in bash just as well. Some say better.

If you're an AppleScripter - BBEdit is pretty good at that - you just might 
want to muck with the PATH that "do shell script" uses.  In 
$HOME/.MacOSX/environment.plist you can reset your PATH variable so that it  is 
honored globally, even when you start up a BBEdit worksheet..

-- 

--> A fair tax is one that you pay but I don't <--

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to