[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mac: Script won't work when executed from bash shell?
From: |
Vic Norton |
Subject: |
Mac: Script won't work when executed from bash shell? |
Date: |
Sat, 1 Feb 2014 12:41:59 -0500 |
Here's a description of my problem. I can't figure out what is wrong. Any ideas?
I'm running Mac OS X 10.9.1 with the latest MacPorts version of Octave.
1) The file
~/Norton/Programming/octave/m/tests/test2.m
contains just three lines:
#!/opt/local/bin/octave -qf
F = rand(3, 3)
[P, Lambda] = minnormy0(F)
2) When I execute test2.m from the bash shell, the F line executes but the
call to minnormy0 produces an error:
~$ cd ./Norton/Programming/octave/m/tests/
tests$ ./test2.m
F =
0.27707 0.64499 0.57826
0.95870 0.93801 0.96575
0.11563 0.12303 0.50396
error: 'minnormy0' undefined near line 3 column 16
error: called from:
error: /Users/vic/Norton/Programming/octave/m/tests/test2.m at line 3, column
14
tests$
3) Why the error? The minnormy0.m function has the path
~/Norton/Projects/MinNormY/Octave/m/minnormy0.m
and
~/.octaverc contains
addpath (genpath ("~/Norton/Projects/MinNormY/Octave/m"));
4) When I open octave in Terminal there is no problem running test2:
~$ octave
GNU Octave, version 3.6.4
...
octave> test2
F =
0.2122514 0.3154166 0.5963612
0.0026350 0.9292381 0.4959029
0.9447314 0.4533054 0.1637449
P =
1
0
0
Lambda =
-Inf
-Inf
octave>
5) What is the problem here? Any ideas?
- Mac: Script won't work when executed from bash shell?,
Vic Norton <=