Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

exec problem



In 4.0.4 when I issue an 'exec' and zsh can't find
the executable it simply terminates without warning.
This is surly not desirable behaviour.

In bash the shell first checks to see if the command
is available and executable and if not it issues an
appropriate error message. The following function approximates
the bash bahaviour.

function exec {
 if [[ $# = 0 ]]; then
   builtin exec
 elif [[ -f $1 ]]; then
   if [[ -x $1 ]]; then
     builtin exec $*
   else
     echo "zsh: exec: $1: cannot execute: Permission denied"
   fi
 else
   echo "zsh: exec: $1: cannot execute: No such file or directory"
 fi
}

Shouldn't this be builtin?


Thanks,
Pascal


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail





Messages sorted by: Reverse Date, Date, Thread, Author