Re: [MAN] Clarify two redirection mechanisms

2014-12-08 Thread Jonathan Nieder
Hi Stéphane, Stéphane Aulery wrote: As for me, I'm not bothered by the word resource. It's ok for me as copy. But Herbert does not agree, so I can not force him:-)). [...] This is my last attempt, if there is no consensus I close the bug regarding Debian. Please don't. I can handle the bug

[PATCH 2/2] [MAN] Clarify trap '' signals syntax in manual page

2014-06-11 Thread Jonathan Nieder
Nieder jrnie...@gmail.com --- ChangeLog | 4 src/dash.1 | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3f59ac2..765b9b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-06-11 Jonathan Nieder jrnie...@gmail.com + + * Clarify

Re: sed script fails to run in dash

2013-11-22 Thread Jonathan Nieder
Hi Tormen, Tormen wrote: sed -e 1$'{w/dev/stdout\n;d}' -i /tmp/x in a dash script will yield the error message: sed: -e expression #1, char 2: unknown command: `$' But why ? :( POSIX sayeth[1]: The '$' character is used to introduce parameter expansion, command substitution,

dash website (Re: Hello)

2013-07-14 Thread Jonathan Nieder
Hi Rémi, Rémi Duplé wrote: Hello, I compose this mail for submit a little suggest for your website (http://gondor.apana.org.au/~herbert/dash/). The dash, is a beautiful shell, simple and usefull, but his website not clearly seem in not at his image. So, as a web developer, I propose to

dash website (Re: Hello)

2013-07-14 Thread Jonathan Nieder
Rémi Duplé wrote: I am writing this mail to propose an overhaul of the current site without creating another site on another domain. If my idea of recasting (free) interest you deprive yourself especially not contact me. Wow, that got ugly fast. I don't have anything against trying out

Re: [PATCH] [MAN] 0 and EXIT both work for exit traps.

2012-12-30 Thread Jonathan Nieder
what it means for an action to be null. Clarify by explicitly referring to an empty string, as opposed to a NULL pointer or the string null. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- ChangeLog | 4 src/dash.1 | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git

Re: [PATCH] printf: use %ll instead of %j

2012-12-03 Thread Jonathan Nieder
Hi Roy, Roy wrote: MSYS libc does not support %j[dXx] format, only %ll[dXx] is supported. Are you sure that using the 'll' modifier here is more portable than 'j'? FWIW there was a patch posted to use PRIdMAX before, which would be a more conservative thing to do and I think should work well.

Re: [PATCH] printf: use %ll instead of %j

2012-12-03 Thread Jonathan Nieder
Harald van Dijk wrote: Here's a slightly tweaked version of that patch. This is easier on the eyes than the version I sent, anyway. :) For what it's worth, Reviewed-by: Jonathan Nieder jrnie...@gmail.com -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message

Re: [PATCH v2] fifo: Do not restart open() if it already found a partner

2012-06-26 Thread Jonathan Nieder
. Yep, I don't have anything left to complain about. Looks obviously correct to my inexpert eyes. Reviewed-by: Jonathan Nieder jrnie...@gmail.com -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [BUG] dash doesn't report syntax error when it should on stray fi

2012-04-23 Thread Jonathan Nieder
Hi Stefano, Stefano Lattarini wrote: How to reproduce: $ dash -c ':; fi'; echo stat = $? stat = 0 Since this doesn't affect conforming scripts, I suspect it falls squarely within the patches welcome as long as they don't make dash bigger category. Thanks for finding it. Sincerely,

Re: [BUG] dash doesn't report syntax error when it should on stray fi

2012-04-23 Thread Jonathan Nieder
Chet Ramey wrote: What are `conforming scripts'? Scripts without syntax errors? I meant conforming POSIX applications. A patch for this might even be welcome if it makes dash bigger, if that's what you're wondering. -- To unsubscribe from this list: send the line unsubscribe dash in the body

Re: [BUG] dash doesn't report syntax error when it should on stray fi

2012-04-23 Thread Jonathan Nieder
Chet Ramey wrote: The way I read 2.10.2, Posix requires that the fi resolve to the reserved word `fi' in this case, since it's in a position where a command name is expected (Rule 1, [Command Name]). I would think that would make it a syntax error in any application, conforming or not. Yes,

Re: /bin/dash -c != /bin/bash -c with pgrep

2012-01-24 Thread Jonathan Nieder
Hi Richard, Richard Retanubun wrote: /bin/dash -c pgrep -f /usr/sbin/atftpd; echo $? -vs- /bin/bash -c pgrep -f /usr/sbin/atftpd; echo $? The dash version returns the PID of the grep itself and thus always succeeds. The bash version works as expected. As the pgrep(1) manual explains, the

Re: Question about job control in non-interactive shells

2012-01-09 Thread Jonathan Nieder
Hi Michael, Michael Welsh Duggan wrote: I am trying to determine why: dash -c sleep 5 kill %1 results in: dash: 1: kill: No such process You are probably looking for the -m option. Thanks for writing, and hope that helps, Jonathan -- To unsubscribe from this list: send the line

[PATCH v2] [BUILTIN] Fix test -x as root on FreeBSD 8

2011-09-27 Thread Jonathan Nieder
-workaround. Reported-by: Christoph Egger christ...@debian.org Analysis-by: Petr Salinger petr.salin...@seznam.cz Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Herbert Xu wrote: So pleas exclude the changes on Linux. Good idea. Even if the person checking can get root permissions to try

Re: [PATCH] [BUILTIN] Make test -x sane again when run as root

2011-09-26 Thread Jonathan Nieder
Jonathan Nieder wrote: [PATCH] [BUILTIN] Make test -x sane again when run as root Quick correction: a better title would be [BUILTIN] Fix test -x as root on platforms with old-fashioned faccessat for brevity (fix contains just as much information as make sane) and to make it more

Re: [PATCH 1/2] [SHELL] Allow building without LINEO support.

2011-08-16 Thread Jonathan Nieder
) { lineno = errlinno; if (funcline) lineno -= funcline - 1; } #endif would make it more palatable. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- src/eval.c | 25 - src/var.c |2 ++ src

Re: [PATCH 2/2] [SHELL] Add top-level autogen.sh

2011-08-16 Thread Jonathan Nieder
David Miller wrote: --- /dev/null +++ b/autogen.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +aclocal \ + autoheader \ + automake --add-missing \ + autoconf Doesn't autoreconf -fis work? -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to

Re: [PATCH 1/2] [SHELL] Allow building without LINEO support.

2011-08-16 Thread Jonathan Nieder
Herbert Xu wrote: So this isn't the reason why Debian has been stuck on 0.5.5.1? If so what is the reason please? Probably just Gerrit being busy and me getting distracted by how to handle the /bin/sh symlink. I'll propose a package for sid that just moves to the latest upstream version with

[PATCH] [MAN] Remove spurious space in descriptions of PS1, PS2, PS4

2011-05-02 Thread Jonathan Nieder
. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Kalle Olavi Niemitalo wrote[1]: Here's the diff against 0.5.5.1-7.4. Thanks. Looking at the formatted output, I see some other extra spaces (mostly around punctuation), but fixing these confusing ones first doesn't sound like a bad idea. [1] http

[PATCH/RFC dash 0/4] Avoid a fork before running last command given to -c

2011-04-10 Thread Jonathan Nieder
Hi, Jilles Tjoelker wrote[0]: Regarding sh -c optimization, I am in favour of this. Uselessly waiting 'sh -c' processes annoy me. I made the change for FreeBSD 8.0 sh, which is very similar to dash. The SVN changeset is r194128. So I grabbed that changeset with svn log -v

[PATCH 1/4] [INPUT] Introduce preadateof predicate to check for end of input

2011-04-10 Thread Jonathan Nieder
From: Jilles Tjoelker jil...@stack.nl Date: Sat, 13 Jun 2009 16:17:45 -0500 For example, this can be used to detect tail calls in the string passed to -c. [jn: originally from Jilles as part of FreeBSD SVN r194128] Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Could be squashed

[PATCH 2/4] [EVAL] Make eval flags public

2011-04-10 Thread Jonathan Nieder
, always use 0 (no flags). Expose the flags in eval.h so that can change. [jn: originally from Jilles as part of FreeBSD SVN r194128; split up for clarity.] Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- src/eval.c |5 - src/eval.h |5 + 2 files changed, 5 insertions(+), 5

[PATCH 3/4] [EVAL] Take advantage of EV_EXIT in evalstring

2011-04-10 Thread Jonathan Nieder
insert a evaltree(NULL, flags); call before popfile() to get the original's semantics. Any outstanding bugs are my fault.] Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- src/eval.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/eval.c b/src

[PATCH 4/4] [MAIN] Optimize dash -c command to avoid a fork

2011-04-10 Thread Jonathan Nieder
r194128. Bugs are mine.] Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- src/main.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/main.c b/src/main.c index b38dc27..af987c6 100644 --- a/src/main.c +++ b/src/main.c @@ -171,7 +171,7 @@ state2: state3

[PATCH 5/4] [EVAL] Remove unused EV_BACKCMD flag

2011-04-10 Thread Jonathan Nieder
is no more. Let's finish the job and remove the last vestiges. If someone wants to work on omitting the fork in backcmd, the remaining hints are not going to be very helpful, anyway. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Thanks for reading. Thoughts? The new sizes in the cover letter

Re: [PATCH] Allow == as synonym for = in test

2011-03-07 Thread Jonathan Nieder
Hi David, David A. Wheeler wrote: But is == a misfeature? I don't think so. For what it's worth, I have no strong objections to == (though no great excitement about it either). I was only taking the opportunity to explain the possibly mysterious-seeming current feature set. Jonathan Nieder

Re: [PATCH] Allow == as synonym for = in test

2011-03-06 Thread Jonathan Nieder
Hi David, David A. Wheeler wrote: This isn't required by POSIX, but test in dash already supports tests not in POSIX. I think it'd be useful to add one that's already in common use. Thanks for writing this. Generally speaking, dash tends to support features that ash and older versions of

Re: [BUG] Improper 8-bit parsing because of signed overflow

2011-01-17 Thread Jonathan Nieder
Hi Max, max ulidtko wrote: $ cat тест sh: cannot open те�т: No such file With Debian dash 0.5.5.1-7.4: $ dash -c 'cat тест' 21 | LC_ALL=C sed -e 's/dash: cannot open \(.*\):.*/\1/' | xxd 000: d182 d0b5 d1d1 820a $ dash -c 'echo тест' |

Re: dash 0.5.6.1-1, setting IFS to tab, bug?

2011-01-11 Thread Jonathan Nieder
Hi Peter, peter kvillegard wrote: test1(space)test2(tab)test3 (where the (space) is an actual space etc) then: #!/bin/dash cat testfile | while IFS=' ' read col1 col2; do#an actual tab In my mailreader, this shows as while SP IFS=' SP SP HT ' SP read ... In

Re: read() builtin doesnt read integer value /proc files (but bashs does)

2010-12-15 Thread Jonathan Nieder
Hi Cristian, Cristian Ionescu-Idbohrn wrote: On Sun, 28 Nov 2010, Herbert Xu wrote: On Sat, Sep 04, 2010 at 07:35:04PM +, Jilles Tjoelker wrote: This discarding is still bad as it throws away valid data if the open file description is shared. This happens if stdin is redirected inside a

Re: [PATCH] [PARSER] Remove backslash before } in double-quotes in variable

2010-11-21 Thread Jonathan Nieder
Hi, Jilles Tjoelker wrote: The backslash prevents the closing brace from terminating the substitution, therefore it should be removed. Thanks! printf %s\n ${$+\}} ${$+\}} ${$+\}} should print } three times, without backslashes. Thanks especially for the example. The standard makes

Re: Quoted closing brace in variable default expansion

2010-11-13 Thread Jonathan Nieder
Hi Herald, Harald van Dijk wrote: $ ksh -c 'echo ${x:-}}' } $ dash -c 'echo ${x:-}}' dash: 1: Syntax error: Unterminated quoted string $ busybox sh -c 'echo ${x:-}}' sh: syntax error: unterminated quoted string It looks like dash and other ash derivatives stop the expansion

Re: sensible local support?

2010-11-07 Thread Jonathan Nieder
Jim Meyering wrote: Would you be open to the idea of making dash's local work more like the scope modifier that its name implies than like a separate command in which assignments have different semantics? To be clear, local is not standardized, so the change I'm advocating would not be a

Re: [Partial patch] IFS and read builtin

2010-11-07 Thread Jonathan Nieder
Hi Herbert et al, Herbert Xu wrote: commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa Author: Herbert Xu herb...@gondor.apana.org.au Date: Wed Sep 8 20:07:26 2010 +0800 [EXPAND] Fix ifsfirst/ifslastp leak Another puzzle bisecting to f42e443bb. This one comes from the grub-mkconfig

[BUG?] here documents, command substitution, and the { keyword

2010-11-06 Thread Jonathan Nieder
Hi, Just ran into some strange behavior: $ cat test.sh #!/bin/sh echo hello greeting cat EOF $(cat greeting) EOF { echo $? cat greeting } /dev/null $ sh test.sh hello test.sh: 7: {: not found 127 hello test.sh: 10: Syntax error: } unexpected bash, mksh, pdksh, and ksh93 all

Re: [BUG?] here documents, command substitution, and the { keyword

2010-11-06 Thread Jonathan Nieder
Jonathan Nieder wrote: $ sh test.sh hello test.sh: 7: {: not found 127 hello test.sh: 10: Syntax error: } unexpected bash, mksh, pdksh, and ksh93 all print hello as expected. The problem is reproducible with all versions of dash in the git repo. err, by this I mean: $ bash test.sh

Re: [Partial patch] IFS and read builtin

2010-10-17 Thread Jonathan Nieder
Herbert Xu wrote: On Sat, Oct 16, 2010 at 02:15:48PM -0500, Jonathan Nieder wrote: Bisects to f42e443bb. Reverting it avoids the problem. Any ideas before I investigate further? Does this patch help? Yes, thanks! -- To unsubscribe from this list: send the line unsubscribe dash in the body

Re: [Partial patch] IFS and read builtin

2010-10-16 Thread Jonathan Nieder
Hi Herbert, Herbert Xu wrote: commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa Author: Herbert Xu herb...@gondor.apana.org.au Date: Wed Sep 8 20:07:26 2010 +0800 [EXPAND] Fix ifsfirst/ifslastp leak As it stands expandarg may return with a non-NULL ifslastp which then

Re: [PATCH 2/3] Revert Eliminated global exerrno.

2010-10-07 Thread Jonathan Nieder
Herbert Xu wrote: sh -c 'trap exec nosuchfile EXIT; exit 3'; echo $? This makes dash exit with 127 instead of 3 as it does now. AFAIK the wording of POSIX is such that we should return 3, however, it does seem that every other shell exits with 127. On 'exec': If exec is specified

[PATCH] [OPTIONS] Use exit status 127 when the script to run does not exist

2010-10-06 Thread Jonathan Nieder
://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html#tag_20_117_14 Reported-by: Clint Adams sch...@debian.org Fixes: http://bugs.debian.org/548743 Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Herbert Xu wrote: This is wrong. You're creating exactly the problem that Jilles was talking

[PATCH] [INPUT] Catch attempts to run a directory as a script

2010-10-06 Thread Jonathan Nieder
to be a file, not a directory. So diagnose this with an error message and exit with status 2. Reported-by: Jari Aalto jari.aa...@cante.net Fixes: http://bugs.debian.org/548687 Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Applies on top of the previous patch, which is based on master. Thanks

Re: [PATCH] [INPUT] Catch attempts to run a directory as a script

2010-10-06 Thread Jonathan Nieder
Herbert Xu wrote: On Wed, Oct 06, 2010 at 05:08:04AM -0500, Jonathan Nieder wrote: But POSIX makes it clear enough that in sh command_file, command_file is supposed to be a file, not a directory. So diagnose this with an error message and exit with status 2. [...] Is this required by POSIX

[PATCH 0/3] Fix exit status for 'exec nonexistent' and 'exec .'

2010-10-06 Thread Jonathan Nieder
/gmane.comp.shells.dash/291/focus=390 for a patch[2]. Thoughts? Jonathan Nieder (3): [EXCEPTIONS] Stop documenting EXSHELLPROC Revert Eliminated global exerrno. [EXCEPTIONS] Eliminate global exerrno src/TOUR| 11 +-- src/error.h |5 ++--- src/eval.c |8 3

[PATCH 1/3] [EXCEPTIONS] Stop documenting EXSHELLPROC

2010-10-06 Thread Jonathan Nieder
At some point between ash 0.3.5-11.0.1 and ash 0.3.8-37, Debian ash stopped using the EXSHELLPROC exception to handle shell scripts without a magic number. Remove all remaining references to it to avoid confusion. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- src/TOUR| 11

[PATCH 2/3] Revert Eliminated global exerrno.

2010-10-06 Thread Jonathan Nieder
2 According to POSIX: If command is not found, the exit status shall be 127. If command is found, but it is not an executable utility, the exit status shall be 126. Make it so again. Reported-by: Eric Blake ebl...@redhat.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- src/error.h

Re: [PATCH 1/3] [EXCEPTIONS] Stop documenting EXSHELLPROC

2010-10-06 Thread Jonathan Nieder
Herbert Xu wrote: On Wed, Oct 06, 2010 at 08:03:47PM -0500, Jonathan Nieder wrote: --- a/src/error.h +++ b/src/error.h @@ -66,9 +66,8 @@ extern int exception; /* exceptions */ #define EXINT 0 /* SIGINT received */ #define EXERROR 1 /* a generic error */ -#define

Re: [PATCH 2/3] Revert Eliminated global exerrno.

2010-10-06 Thread Jonathan Nieder
), this causes the exit status from exec not to be clobbered. For example, without this patch: $ sh -c 'trap exec nonexistent EXIT'; echo $? exec: 1: nonexistent: not found 0 And with it: $ sh -c 'trap exec nonexistent EXIT'; echo $? exec: 1: nonexistent: not found 127 Signed-off-by: Jonathan Nieder

[PATCH v2] [EXCEPTIONS] Stop documenting EXSHELLPROC

2010-10-06 Thread Jonathan Nieder
At some point between ash 0.3.5-11.0.1 and ash 0.3.8-37, Debian ash stopped using the EXSHELLPROC exception to handle shell scripts without a magic number. Remove all remaining references to it to avoid confusion. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Herbert Xu wrote: Yeah