help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Navigating directories in Macintosh and octave


From: Henry F. Mollet
Subject: Re: Navigating directories in Macintosh and octave
Date: Mon, 25 Jul 2005 20:54:05 -0700
User-agent: Microsoft-Entourage/11.1.0.040913

Your .bashrc should look something like this:
[~] -bash-2.05b 549$ cat .bashrc
PATH=/usr/local/bin:$PATH  %new PATH added to old/existing PATH.
export PATH
export GNUTERM=aqua
export DISPLAY=:0.0

I assume that the suggested use of an alias across different directories
should work but I assume that it is better to give the actual PATH as shown
above. Please note that the new Path is added to the one created by the
system. Always a good idea to save a back-up or as you have done to create a
new .bashrc in your home directory rather than mess with the system bashrc.

Now I have a bit more to say about this. Please somebody tell me that I'm
making a mountain out of a mole.
Henry

I'm sure that PATH and LOADPATH are quite easy once you understand it but I
find it as elusive as ever. I've come to the conclusion that it's less work
to cd to the correct directory with the application than messing around with
the PATH, although my system has no problem finding octave and gnuplot.

As an aside, on a Mac with OS >10.2, you can drag the path from the Finder
into the Terminal window. But if Octave is in usr/local then to find it, you
need to use Go/Go to folder. (expletive deleted)

Octave and Gnuplot are located on my eMac with OS 10.4.2 with installation
from source in /usr/local/bin and the below $PATH covers it.

[~] -bash-2.05b 545$ echo $PATH
/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/Users/hfm::/u
sr/X11R6/bin

The question becomes how was this $PATH created in the first place. I.e.
default $PATH (assuming BASH, it would be /etc/profile) plus whatever was
added in a number of "login" files in the home directory.

According to the Bash Reference Manual on p. 65. If BASH is invoked as an
interactive login shell it reads and executes /etc/profiles first. Then it
it goes to the home directory and reads and executes ~/.bash-profile,
~/.bash_login, and ~/.profile if present. On exiting it reads and executes
~/.bash_provile if present.

When invoked as an interactive non-login shell then BASH reads and executes
~/bashrc. I believe that I'm working with a login shell and therefore have
not yet understood why the Path additions should go into ./bashrc rather
than ./bash_profile. I guess it's best to put them into both to be on the
save side?

Now once the login shell (BASH) can find Octave then I assume that
additional login shells have to be found and executed so that octave and
octave-forge will actually run?
[~] -bash-2.05b 548$ cat .octaverc
LOADPATH = [ 
':/usr/local/bin:/usr/local/libexec/octave/2.1.71/site/oct/powerpc-apple-dar
win8.1.0/octave-forge:/usr/local/share/octave/2.1.71/site/m/octave-forge//:'
, LOADPATH ];
   EXEC_PATH = [ 
'/usr/local/libexec/octave/2.1.71/site/exec/powerpc-apple-darwin8.1.0:',
EXEC_PATH ];
__gnuplot_raw__ ("set mouse\n;")
automatic_replot = 0

Alternatively, as I said, you can give an absolute Path to get Octave
started. Or if you're in the correct directory you can type in "octave".
Well, not quite. You have to use ./octave because you have to tell the shell
to look in the pwd. If the path is properly set up, then you'll see a
trailing : that indicates the PWD (entirely different from the separating :
between different path).

  
on 7/25/05 7:30 PM, address@hidden at address@hidden
wrote:

> Henry
> 
> Thanks for the directions.  Yes I did write the file
> as directed by Nathan.  I restarted a new terminal but
> the typed command "octave" (without the quotes returns
> -bash: octave: command not found
> Reading the file is as below.
> 
> $ cat .bashrc     results in
> 
> Allan's-Computer:~ allangol$ cat .bashrc
> alias octave="/usr/local/bin/octave"
> Allan's-Computer:~ allangol$
> 
> I won't even attempt to deal with LOADPATH at this
> point.  Any ideas??
> 
> Thank you
> 
> Allan
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]