#11790: `sage --sh -c ...` shouldn't print [that many] messages
-----------------------+----------------------------------------------------
   Reporter:  leif     |          Owner:                                        
                   
       Type:  defect   |         Status:  needs_review                          
                   
   Priority:  minor    |      Milestone:  sage-4.7.2                            
                   
  Component:  scripts  |       Keywords:  subshell commands sage-sage 
environment batch mode stdout
Work_issues:           |       Upstream:  N/A                                   
                   
   Reviewer:           |         Author:  John Palmieri                         
                   
     Merged:           |   Dependencies:  #11866                                
                   
-----------------------+----------------------------------------------------

Comment(by jhpalmieri):

 Like this?
 {{{
 #!diff
 diff --git a/sage-sage b/sage-sage
 --- a/sage-sage
 +++ b/sage-sage
 @@ -473,7 +473,7 @@ if [ "$1" = '-sh'  -o "$1" = '--sh' ]; t
      cd "$CUR"
      shift
      if [ "$1" = '-c' ]; then
 -       exec $SHELL "$@"
 +       exec "$SHELL" "$@"
          # If 'exec' returns, an error occurred:
          status=$?
          echo >&2 "Fatal error: 'exec \"$SHELL\" \"$@\"' failed!"
 @@ -489,8 +489,8 @@ if [ "$1" = '-sh'  -o "$1" = '--sh' ]; t
      echo "" 1>&2
      # We must start a new shell with no .profile or .bashrc files
      # processed, so that we know our path is correct
 -    SHELL_NAME=`basename $SHELL`
 -    case $SHELL_NAME in
 +    SHELL_NAME=`basename "$SHELL"`
 +    case "$SHELL_NAME" in
          bash)
              SHELL_OPTS=" --norc"
              PS1="SAGE_ROOT=${SAGE_ROOT}\n(sage subshell) \h:\W \u\$ "
 @@ -531,7 +531,7 @@ PS1="SAGE_ROOT=${SAGE_ROOT}
              echo >&2 "Aborting."
              exit 1
      esac
 -    $SHELL $SHELL_OPTS "$@"
 +    "$SHELL" $SHELL_OPTS "$@"
      status=$?
      echo "Exited Sage subshell." 1>&2
      exit $status
 }}}
 Let's make this v2 of the patch.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11790#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to