On 2/22/11 5:17 PM, Justin C. Walker wrote:

On Feb 22, 2011, at 14:52 , Jason Grout wrote:

On 2/22/11 3:10 PM, Justin C. Walker wrote:

On Feb 22, 2011, at 11:44 , Jason Grout wrote:


I don't see what you see; perhaps one of us has sufficiently strange setup in 
our startup files to either mask or cause the problems.

It might be that I my default shell set to zsh.  Could you try changing your 
shell (using chsh) to zsh and then testing the value of $PATH after doing sage 
-sh?

Gee.  Ya think?  :-}

Here's what I get (again, fresh Terminal window):

Last login: Tue Feb 22 15:10:38 on ttys009
zippo% echo $SHELL
zsh
zippo% PATH='.';export PATH
/usr/libexec/path_helper -s
zippo% /usr/libexec/path_helper -s
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin:/usr/X11/bin:.";
 export PATH;
zippo%

It seems that when I set my default shell to bash, the $PATH variable is set 
correctly in sage -sh.

Doesn't the Sage environment kind of assumes 'bash' is your shell?  I've never 
thought about it, but a quick check of '$SAGE_ROOT/local/bin' shows that at 
least some of the shell files insist on it.


The code in sage-sage seems to indicate support for lots of different shells. Here is the code to launch the shell from sage -sh. You can see that not only does sage-sage specifically launch whatever shell the user defaults to, but also includes configuration for a number of popular options. If Sage only supports bash as a shell, then shouldn't SHELL_NAME be set to `which bash` or `/usr/bin/env bash`?

    SHELL_NAME=`basename $SHELL`
    echo "Bypassing shell configuration files ..."
    echo
    # We must start a new shell with no .profile or .bashrc files
    # processed, so that we know our path is correct
    PS1="SAGE_ROOT=${SAGE_ROOT}\n(sage subshell) \h:\W \u\$ "
    export PS1
    case $SHELL_NAME in
        bash)
            SHELL_OPTS=" --norc"
            ;;
        csh)
            SHELL_OPTS=" -f"
            ;;
        ksh)
            SHELL_OPTS=" -p"
            ;;
        sh)
            SHELL_OPTS=" --norc"
            ;;
        tcsh)
            SHELL_OPTS=" -f"
            ;;
        zsh)
            SHELL_OPTS=" -f -d"
            ;;
        *)
            echo >&2 "Unknown shell: $SHELL!"
            echo >&2 "Exiting Sage."
            exit 1
    esac

    $SHELL_NAME $SHELL_OPTS "$@"

So I guess the problem is narrowed down to: sage -sh doesn't work when zsh is your default shell on OSX 10.6.6.

Thanks,

Jason

--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to