cc: [email protected]
Subject: Re: [ast-users] ksh bugs?
--------

Here are the responses to the first three of your problem reports.  More
will follow:

> Some of these may be expected behavior.
> In each case I'd like to know if that's the case.
> 
> 1)
> This worked up through the 2009-05-01 version:
> [[ \] == [x\]y] ]] && print ok
> It no longer works as of 2009-12-24.

This change was need in order to align with the posix sh spec for [...].
the last sentence is the one in play:

  A bracket expression is either a matching list expression
  or a non-matching list expression. It consists of one or
  more expressions: collating elements, collating symbols,
  equivalence classes, character classes, or range
  expressions. The <right-square-bracket> ( ']' ) shall lose
  its special meaning and represent itself in a bracket
  expression if it occurs first in the list (after an initial
  <circumflex> ( '^' ), if any). Otherwise, it shall
  terminate the bracket expression, unless it appears in a
  collating symbol (such as "[.].]" ) or is the ending
  <right-square-bracket> for a collating symbol, equivalence
  class, or character class. The special characters '.' , '*'
  , '[' , and '\\' ( <period>, <asterisk>,
  <left-square-bracket>, and <backslash>, respectively) shall
  lose their special meaning within a bracket expression.
> 
> 2)
> time | cat
> -ksh: syntax error: `|' unexpected
time is not a simple command.  It is reserved would that is
optionally followed by a pipeline.  Since time is followed by
        | cat
and | cat is not a pipeline, this is a syntax error.
> 
> 3)
> $ touch \#foo
> $ ls #<tab>
> expands to
> $ ls #foo
> I think a leading # in a word should be escaped in tab expansion.
> 
This will be changed in ksh93u for insert a \ in front of file names
beginning with #.

> 7)
> This gives a memory fault:
> output=$(printf "%10000s"); [[ $output == *(?) ]]
The memory fault is a stack overflow.  You can use ulimit -s to increase
the stack size and prevent the memory fault.  However, the question is
why it required as much stack as it did and this is being investigated.
> 
> 8)
> echo foo | od /dev/fd/0
> od: /dev/fd/0: No such device or address
This is because Linux doesn't support /dev/fd/0 for socketpair which
is used by ksh93 for pipelines.  I believe that this is a Linux bug.
> And perhaps related:
> function ft { /bin/echo foo; }; : $(od <(ft))
> foo
> 
This has been fixed since ksh93 now uses pipes for process substitution.

David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to