All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: dash@vger.kernel.org
Cc: Jilles Tjoelker <jilles@stack.nl>
Subject: Re: [PATCH] Improved LINENO support
Date: Fri, 12 Nov 2010 19:16:09 +0059	[thread overview]
Message-ID: <4CDD8481.1060306@gigawatt.nl> (raw)
In-Reply-To: <20101110220008.GC17871@stack.nl>

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.

  parent reply	other threads:[~2010-11-12 18:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-08 20:33 [PATCH] Improved LINENO support Harald van Dijk
2010-11-10 22:00 ` Jilles Tjoelker
2010-11-11 20:33   ` Harald van Dijk
2010-11-12 18:17   ` Harald van Dijk [this message]
2010-11-12 18:35     ` Eric Blake
2010-11-12 19:08       ` Harald van Dijk
2010-11-12 19:40         ` Harald van Dijk
2010-11-12 21:29         ` Jilles Tjoelker
2010-11-27 16:56           ` Harald van Dijk
2011-03-10  8:10             ` Herbert Xu
2011-03-11 21:56               ` Harald van Dijk
2011-03-15  7:52                 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CDD8481.1060306@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=dash@vger.kernel.org \
    --cc=jilles@stack.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.