Hi

Excerpt from the manual:
/--/
For  example, the predefined alias redirect='command exec' prevents a
script from terminating when an invalid redirection  is given.
/--/

The following happens under x86_64 Linux (SLES), but also happens under
old FreeBSD 4-STABLE with Version M 1993-12-28 r.

$ print ${.sh.version}
Version JM 93t+ 2009-06-30
$ ls -la jura.log
-rw-r--r-- 1 root root 0 10. nov   12:53 jura.log
$ id
uid=XXX(vallo) gid=XXX(users)
$ set +e
$ exec 3>jura.log
ksh: jura.log: cannot create [Permission denied]
$ redirect 3>jura.log
ksh: jura.log: cannot create [Permission denied]
$ set -e
$ exec 3>jura.log
ksh: jura.log: cannot create [Permission denied]
$ redirect 3>jura.log
ksh: jura.log: cannot create [Permission denied]
myhakas:vallo$ echo $?
1

Reading the manual it seems that failing redirection using special
builtin exec should abort the shell. This is not happening. What's more
weird in second case with set -e the redirect aborts the shell.
Am I reading it backwards or what?
-- 
Vallo Kallaste
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to