Re: [PATCH] Improved LINENO support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/11/10 22:59, Jilles Tjoelker wrote:
What I was thinking of was adding a lineno field to narg instead of to
all command types. The lineno variable would then be set by expand.c. I
think that leads to a smaller patch and it should still give a sensible
value for almost all errors.

Unfortunately, I do not believe this will work. In

  echo $LINENO \
    $LINENO

two identical numbers must be printed, because LINENO is supposed to be set when a command is executed. It is not supposed to change during the execution of the command. Taking the first word of a command also will not work:

  (
    :
    :
    :
    :
    :
  ) >test-$LINENO

should write to file test-1, not test-7, even though the only word is on line 7. bash gets this wrong, pdksh gets this almost right.

If I am missing an obvious way to address these issues, or if I am missing some part of the standard that clarifies why these issues do not exist, please share, but otherwise I will take the rest of your suggestions and rework my first patch, storing the line number for each command.
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux