octave stole my Terminal

View: New views
5 Messages — Rating Filter:   Alert me  

octave stole my Terminal

by moc.elbban :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is an OS X problem.  Everytime I start my terminal, it starts octave.  And when I enter 'quit', it quits the shell.  So then, the only way I can run commands is by typing, for example, "system('ls')".  There is nothing in my .bashrc or .profile that is sneaky.  

Here is what happens when I start a new shell in Terminal and then check my processes:
"

Last login: Wed Sep 12 13:49:59 on ttyp1
Welcome to Darwin!
exec '/Applications/Octave.app/Contents/Resources/bin/octave'
XXX:~ XXX$ exec '/Applications/Octave.app/Contents/Resources/bin/octave'
GNU Octave, version 2.9.13
Copyright (C) 2007 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.

Octave was configured for "i386-apple-darwin8.9.1".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Report bugs to <bug@octave.org> (but first, please read
http://www.octave.org/bugs.html to learn how to write a helpful report).

For information about changes from previous versions, type `news'.

octave-2.9.13:1> system('ps aux | grep ctave')
XXX     956   0.0  0.1    27728    640  p1  S+    1:50PM   0:00.02 /bin/sh /Applications/Octave.app/Contents/Resources/bin/octave
XXX     978   0.0  1.7    98376  17380  p1  S+    1:50PM   0:01.09 /Applications/Octave.app/Contents/Resources/bin/octave-2.9.13
XXX     979   0.0  0.1    27728    596  p1  S+    1:51PM   0:00.00 sh -c ps aux | grep ctave
XXX     981   0.0  0.0    18060    240  p1  R+    1:51PM   0:00.00 grep ctave
ans = 0
octave-2.9.13:2>
"

  I see that line "exec '/Applications/Octave.app/Contents/Resources/bin/octave'" up top.  Its a sneaky one, can't find out who's putting it there.  Any ideas?  I'm on a MacBook running 10.4.10.

-seth

Re: octave stole my Terminal

by Thomas Treichl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Right Moc, but I wouldn't say this is a problem, this is new and wanted and
depends on how Octave.app is started. If you double-click the icon or call from
command line

   open /Applications/Octave.app

then we start a new process (Terminal.app) and therefore we need to terminate
that process again after the call of 'quit' or 'exit' (Apple App behavior). So
what to do with the 'terminated process Terminal.app' - the Terminal never gets
active anymore!? Set in your Preferences of Terminal.app that the window should
be closed if bash is exited, so that you can see the feature completely working.

The other solution is to start up octave from the command line by just typing eg.

   /Applications/Octave.app/Contents/Resources/bin/octave

(or you already have created a link to this file placed eg. in /usr/bin and then
simply call octave - read Readme.html of *.dmg about how to do it) then you get
back to the bash after the call of "quit" (Unix shell command behavior) because
Octave runs on top of bash in the same Terminal.app.

Without promise I hope that it also works like this on your PPC platform?!

   Thomas

moc.elbban schrieb:

> This is an OS X problem.  Everytime I start my terminal, it starts octave.
> And when I enter 'quit', it quits the shell.  So then, the only way I can
> run commands is by typing, for example, "system('ls')".  There is nothing in
> my .bashrc or .profile that is sneaky.  
>
> Here is what happens when I start a new shell in Terminal and then check my
> processes:
> "
>
> Last login: Wed Sep 12 13:49:59 on ttyp1
> Welcome to Darwin!
> exec '/Applications/Octave.app/Contents/Resources/bin/octave'
> XXX:~ XXX$ exec '/Applications/Octave.app/Contents/Resources/bin/octave'
> GNU Octave, version 2.9.13
> Copyright (C) 2007 John W. Eaton and others.
> This is free software; see the source code for copying conditions.
> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
> FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
>
> Octave was configured for "i386-apple-darwin8.9.1".
>
> Additional information about Octave is available at http://www.octave.org.
>
> Please contribute if you find this software useful.
> For more information, visit http://www.octave.org/help-wanted.html
>
> Report bugs to <bug@...> (but first, please read
> http://www.octave.org/bugs.html to learn how to write a helpful report).
>
> For information about changes from previous versions, type `news'.
>
> octave-2.9.13:1> system('ps aux | grep ctave')
> XXX     956   0.0  0.1    27728    640  p1  S+    1:50PM   0:00.02 /bin/sh
> /Applications/Octave.app/Contents/Resources/bin/octave
> XXX     978   0.0  1.7    98376  17380  p1  S+    1:50PM   0:01.09
> /Applications/Octave.app/Contents/Resources/bin/octave-2.9.13
> XXX     979   0.0  0.1    27728    596  p1  S+    1:51PM   0:00.00 sh -c ps
> aux | grep ctave
> XXX     981   0.0  0.0    18060    240  p1  R+    1:51PM   0:00.00 grep
> ctave
> ans = 0
> octave-2.9.13:2>
> "
>
>   I see that line "exec
> '/Applications/Octave.app/Contents/Resources/bin/octave'" up top.  Its a
> sneaky one, can't find out who's putting it there.  Any ideas?  I'm on a
> MacBook running 10.4.10.
>
> -seth

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: octave stole my Terminal

by Henry F. Mollet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thomas explained this to be before. I believe it has nothing to do with
octave (see below)
Henry
 [~] -bash-2.05b 502$ ls
Adobe_SVG_3.0 _nstaller_Log     Sites
CMakeTmp                        Sites_extra
cut

 [~] -bash-2.05b 503$ exec ls
Adobe_SVG_3.0 _nstaller_Log     Sites
CMakeTmp                        Sites_extra
cut
[Process completed]
% Now I have to open a new shell


on 9/12/07 12:17 PM, Thomas Treichl at Thomas.Treichl@... wrote:

> Right Moc, but I wouldn't say this is a problem, this is new and wanted and
> depends on how Octave.app is started. If you double-click the icon or call
> from
> command line
>
>    open /Applications/Octave.app
>
> then we start a new process (Terminal.app) and therefore we need to terminate
> that process again after the call of 'quit' or 'exit' (Apple App behavior). So
> what to do with the 'terminated process Terminal.app' - the Terminal never
> gets
> active anymore!? Set in your Preferences of Terminal.app that the window
> should
> be closed if bash is exited, so that you can see the feature completely
> working.
>
> The other solution is to start up octave from the command line by just typing
> eg.
>
>    /Applications/Octave.app/Contents/Resources/bin/octave
>
> (or you already have created a link to this file placed eg. in /usr/bin and
> then
> simply call octave - read Readme.html of *.dmg about how to do it) then you
> get
> back to the bash after the call of "quit" (Unix shell command behavior)
> because
> Octave runs on top of bash in the same Terminal.app.
>
> Without promise I hope that it also works like this on your PPC platform?!
>
>    Thomas
>
> moc.elbban schrieb:
>> This is an OS X problem.  Everytime I start my terminal, it starts octave.
>> And when I enter 'quit', it quits the shell.  So then, the only way I can
>> run commands is by typing, for example, "system('ls')".  There is nothing in
>> my .bashrc or .profile that is sneaky.
>>
>> Here is what happens when I start a new shell in Terminal and then check my
>> processes:
>> "
>>
>> Last login: Wed Sep 12 13:49:59 on ttyp1
>> Welcome to Darwin!
>> exec '/Applications/Octave.app/Contents/Resources/bin/octave'
>> XXX:~ XXX$ exec '/Applications/Octave.app/Contents/Resources/bin/octave'
>> GNU Octave, version 2.9.13
>> Copyright (C) 2007 John W. Eaton and others.
>> This is free software; see the source code for copying conditions.
>> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
>> FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
>>
>> Octave was configured for "i386-apple-darwin8.9.1".
>>
>> Additional information about Octave is available at http://www.octave.org.
>>
>> Please contribute if you find this software useful.
>> For more information, visit http://www.octave.org/help-wanted.html
>>
>> Report bugs to <bug@...> (but first, please read
>> http://www.octave.org/bugs.html to learn how to write a helpful report).
>>
>> For information about changes from previous versions, type `news'.
>>
>> octave-2.9.13:1> system('ps aux | grep ctave')
>> XXX     956   0.0  0.1    27728    640  p1  S+    1:50PM   0:00.02 /bin/sh
>> /Applications/Octave.app/Contents/Resources/bin/octave
>> XXX     978   0.0  1.7    98376  17380  p1  S+    1:50PM   0:01.09
>> /Applications/Octave.app/Contents/Resources/bin/octave-2.9.13
>> XXX     979   0.0  0.1    27728    596  p1  S+    1:51PM   0:00.00 sh -c ps
>> aux | grep ctave
>> XXX     981   0.0  0.0    18060    240  p1  R+    1:51PM   0:00.00 grep
>> ctave
>> ans = 0
>> octave-2.9.13:2>
>> "
>>
>>   I see that line "exec
>> '/Applications/Octave.app/Contents/Resources/bin/octave'" up top.  Its a
>> sneaky one, can't find out who's putting it there.  Any ideas?  I'm on a
>> MacBook running 10.4.10.
>>
>> -seth
>
> _______________________________________________
> Help-octave mailing list
> Help-octave@...
> https://www.cae.wisc.edu/mailman/listinfo/help-octave


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: octave stole my Terminal

by novakyu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Henry F. Mollet wrote:
Thomas explained this to be before. I believe it has nothing to do with
octave (see below)
Henry
 [~] -bash-2.05b 502$ ls
Adobe_SVG_3.0 _nstaller_Log     Sites
CMakeTmp                        Sites_extra
cut

 [~] -bash-2.05b 503$ exec ls
Adobe_SVG_3.0 _nstaller_Log     Sites
CMakeTmp                        Sites_extra
cut
[Process completed]
% Now I have to open a new shell
If I understand Moc's problem correctly, I don't think it's "exec"'s behavior that he's having problem with. The problem is every time he launches Terminal, octave is being run, instead of his usual shell (be it /bin/sh or /bin/bash).

My first rather wacky guess would be ... Moc, are you sure your shell isn't "/usr/bin/octave" or something like that? :)

Here's a rather contrived example on Debian: I created a "test" user with "shell" of /usr/bin/octave, and when I try to open a shell as that user ...

===
plato:~# grep test /etc/passwd
test:x:1001:1001:Tester:/home/test:/usr/bin/octave
plato:~# su - test
su: Authentication service cannot retrieve authentication info.
(Ignored)
GNU Octave, version 2.1.73 (i486-pc-linux-gnu).
Copyright (C) 2006 John W. Eaton.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Report bugs to <bug@octave.org> (but first, please read
http://www.octave.org/bugs.html to learn how to write a helpful report).

-su:1>
===

The only thing I couldn't reproduce is the "exec octave" line, as I get:

===
-su:2> system("ps aux | grep octave")
test     28817  0.0  0.1   4992  1380 pts/15   S+   00:17   0:00 sh -c ps aux | grep octave
test     28819  0.0  0.0   3712   708 pts/15   R+   00:17   0:00 grep octave
ans = 0
-su:3>
===

It's actually a mystery to me why I don't see any octave proper running there.

I don't know for sure what additional rc scripts are run in OS X, but you might want to check system files like /etc/profile and /etc/bashrc, etc, etc. You should check any files that your own .bashrc or .bash_profile or .profile, or .login is sourcing.

And, if you are really interested in finding which process is launching that octave, you might try "ps afu" instead. I have to admit I don't know all the switches to ps, but at least in GNU's version of ps (in BSD compatible mode, I think), "f" seems to bring up a tree view that shows the child-parent relationship between processes. If this doesn't work, you can ... well, look at "man ps" on your system to see what option will let you see PPID (parent process ID).

And until you find a real solution, this bandage that I found might work for you too :)

===
-su:13> system("exec bash")
test@plato:~$
===

Regards,

Andrew

Re: octave stole my Terminal

by moc.elbban :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 9/13/07, novakyu <novakyu@...> wrote:

>
>
>
> Henry F. Mollet wrote:
> >
> > Thomas explained this to be before. I believe it has nothing to do with
> > octave (see below)
> > Henry
> >  [~] -bash-2.05b 502$ ls
> > Adobe_SVG_3.0 _nstaller_Log     Sites
> > CMakeTmp                        Sites_extra
> > cut
> >
> >  [~] -bash-2.05b 503$ exec ls
> > Adobe_SVG_3.0 _nstaller_Log     Sites
> > CMakeTmp                        Sites_extra
> > cut
> > [Process completed]
> > % Now I have to open a new shell
> >
>
> If I understand Moc's problem correctly, I don't think it's "exec"'s
> behavior that he's having problem with. The problem is every time he
> launches Terminal, octave is being run, instead of his usual shell (be it
> /bin/sh or /bin/bash).
>
> My first rather wacky guess would be ... Moc, are you sure your shell isn't
> "/usr/bin/octave" or something like that? :)
>
> Here's a rather contrived example on Debian: I created a "test" user with
> "shell" of /usr/bin/octave, and when I try to open a shell as that user ...
>
> ===
> plato:~# grep test /etc/passwd
> test:x:1001:1001:Tester:/home/test:/usr/bin/octave
> plato:~# su - test
> su: Authentication service cannot retrieve authentication info.
> (Ignored)
> GNU Octave, version 2.1.73 (i486-pc-linux-gnu).
> Copyright (C) 2006 John W. Eaton.
> This is free software; see the source code for copying conditions.
> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
> FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
>
> Additional information about Octave is available at http://www.octave.org.
>
> Please contribute if you find this software useful.
> For more information, visit http://www.octave.org/help-wanted.html
>
> Report bugs to <bug@...> (but first, please read
> http://www.octave.org/bugs.html to learn how to write a helpful report).
>
> -su:1>
> ===
>
> The only thing I couldn't reproduce is the "exec octave" line, as I get:
>
> ===
> -su:2> system("ps aux | grep octave")
> test     28817  0.0  0.1   4992  1380 pts/15   S+   00:17   0:00 sh -c ps
> aux | grep octave
> test     28819  0.0  0.0   3712   708 pts/15   R+   00:17   0:00 grep octave
> ans = 0
> -su:3>
> ===
>
> It's actually a mystery to me why I don't see any octave proper running
> there.
>
> I don't know for sure what additional rc scripts are run in OS X, but you
> might want to check system files like /etc/profile and /etc/bashrc, etc,
> etc. You should check any files that your own .bashrc or .bash_profile or
> .profile, or .login is sourcing.
>
> And, if you are really interested in finding which process is launching that
> octave, you might try "ps afu" instead. I have to admit I don't know all the
> switches to ps, but at least in GNU's version of ps (in BSD compatible mode,
> I think), "f" seems to bring up a tree view that shows the child-parent
> relationship between processes. If this doesn't work, you can ... well, look
> at "man ps" on your system to see what option will let you see PPID (parent
> process ID).
>
> And until you find a real solution, this bandage that I found might work for
> you too :)
>
> ===
> -su:13> system("exec bash")
> test@plato:~$
> ===
>
> Regards,
>
> Andrew
> --
> View this message in context: http://www.nabble.com/octave-stole-my-Terminal-tf4431098.html#a12650014
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> Help-octave@...
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>



Hello Andrew, Yes, you seem to understand my problem best.  That
system('bash') bandage works great.  If you'd been right about my
renaming octave to bash or the other way around, that would have been
a real zinger.  I wasn't able to verify that though.  Maybe I DID do a
messy symlink somewhere.    my personal .profile, .bashrc and the
system level /etc/profile and /etc/bashrc offer no hints.  Whatever is
going on, Octave's 'system' command doesn't recognize the alias 'la'
that I define for 'ls -la' in my .profile, either if doesn't get as
far as my .profile or it is calling a different shell.  When I delete
Octave.app and start Terminal I get the following:
"
Last login: Thu Sep 13 15:51:40 on ttyp1
Welcome to Darwin!
xxx:~ xxx$ exec '/Applications/Octave.app/Contents/Resources/bin/octave'
-bash: /Applications/Octave.app/Contents/Resources/bin/octave: No such
file or directory
-bash: exec: /Applications/Octave.app/Contents/Resources/bin/octave:
cannot execute: No such file or directory
xxx:~ xxx$
"


Tricky, huh?
I'll dig around for other config files that bash or Terminal dig
through before initializing.  I guess at this point the problem is no
longer in this list's domain.  Thanks much for your help up to now.

-seth
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave