Menu

#3516 macOS launch script fails when default shell is TCSH

open
nobody
Mac (2) shell (1)
5
2019-01-22
2019-01-08
No

Hello,

This bug report is for Maxima 5.42.1 running under macOS 10.13.6 (full build info below).

When a user's default shell is tcsh the main.scpt launch script fails due to execution of bash/sh commands.

I've found two possible solutions: 1) pipe the commands to bash, or 2) use the "do shell script" command (which always uses bash) instead of opening a terminal and using "do script" as is currently done.

Text versions of the script for both solutions are attached.

-Larry

wxMaxima version: 18.10.1
using wxWidgets version: wxWidgets 3.1.1
Maxima version: 5.42.1
Maxima build date: 2018-10-18 19:07:57
Host type: x86_64-apple-darwin13.4.0
System type: Darwin 17.7.0 X86-64
Lisp implementation type: SBCL
Lisp implementation version: 1.4.12

2 Attachments

Related

Bugs: #3516

Discussion

  • Robert Dodier

    Robert Dodier - 2019-01-21
    • labels: --> Mac, shell
     
    • Larry Edwards

      Larry Edwards - 2019-01-22

      Hi Robert,

      The bash command set is a superset of the sh command set, and I believe it
      is backwards compatible with sh. Tcsh doesn't use the same syntax or
      keywords as bash or sh (it is a superset of csh, the other early Unix
      shell). Below are equivalent bash and tcsh commands.

      bash/sh:

      bar="hello"
      export foo="there"

      tcsh/csh:

      set bar = "hello"
      setenv foo "there"

      Both of the AppleScript scripts I attached in my bug report should work no
      matter what the user's default shell is (although I've only tested with
      tcsh), and are fairly minimal modifications of the original AppleScript
      scripts.

      Personally I'd choose the version that doesn't briefly open a Terminal
      window, but there may have been reasons for opening a Terminal window which
      I am unaware of (debugging?).

      Cheers,

      -Larry

      On Sun, Jan 20, 2019 at 11:08 PM Robert Dodier robert_dodier@users.sourceforge.net wrote:

      • labels: --> Mac, shell
      • Comment:

      Larry, thanks for working on this problem. What are the commands which
      cause trouble for tcsh? I think some effort has been made to avoid
      bash-specific commands and use only sh commands. Perhaps it's possible to
      modify things so that tcsh is accommodated too.


      Status: open
      Group: Includes_proposed_fix
      Labels: Mac shell
      Created: Tue Jan 08, 2019 10:27 PM UTC by Larry Edwards
      Last Updated: Tue Jan 08, 2019 10:27 PM UTC
      Owner: nobody
      Attachments:

      Hello,

      This bug report is for Maxima 5.42.1 running under macOS 10.13.6 (full
      build info below).

      When a user's default shell is tcsh the main.scpt launch script fails due
      to execution of bash/sh commands.

      I've found two possible solutions: 1) pipe the commands to bash, or 2) use
      the "do shell script" command (which always uses bash) instead of opening a
      terminal and using "do script" as is currently done.

      Text versions of the script for both solutions are attached.

      -Larry

      wxMaxima version: 18.10.1
      using wxWidgets version: wxWidgets 3.1.1
      Maxima version: 5.42.1
      Maxima build date: 2018-10-18 19:07:57
      Host type: x86_64-apple-darwin13.4.0
      System type: Darwin 17.7.0 X86-64
      Lisp implementation type: SBCL
      Lisp implementation version: 1.4.12


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/maxima/bugs/3516/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #3516

  • Robert Dodier

    Robert Dodier - 2019-01-21

    Larry, thanks for working on this problem. What are the commands which cause trouble for tcsh? I think some effort has been made to avoid bash-specific commands and use only sh commands. Perhaps it's possible to modify things so that tcsh is accommodated too.

     
  • Larry Edwards

    Larry Edwards - 2019-01-22

    Hi Robert,

    I replied to your coment in email (I'm on the maxima bugs mailing list), I'm new to this so not sure if my reply will show up here. In case, it doesn't I've included it below. Apologies if this is redundant.

    The bash command set is a superset of the sh command set, and I believe it is backwards compatible with sh. Tcsh doesn't use the same syntax or keywords as bash or sh (it is a superset of csh, the other early Unix shell). Below are equivalent bash and tcsh commands.

    bash/sh:

    bar="hello"
    export foo="there"

    tcsh/csh:

    set bar = "hello"
    setenv foo "there"

    Both of the AppleScript scripts I attached in my bug report should work no matter what the user's default shell is (although I've only tested with tcsh), and are fairly minimal modifications of the original AppleScript scripts.

    Personally I'd choose the version that doesn't briefly open a Terminal window, but there may have been reasons for opening a Terminal window which I am unaware of (debugging?).

    Cheers,

    -Larry

     

Log in to post a comment.