Re: [BUG] 'nolog' and 'debug' options cause "$-" to wreak havoc

2017-03-29 Thread Stephane Chazelas
2017-03-29 21:02:19 +0200, Martijn Dekker: [...] > [*] "nolog: Prevent the entry of function definitions into the command > history; see Command History List." > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_25_03 [...] For the record, nolog is approved for deprec

Re: Tests [ 0 -eq $UID ] don't work as in bash

2016-09-07 Thread Stephane Chazelas
2016-09-07 11:55:00 -0400, Paul Smith: > On Wed, 2016-09-07 at 16:44 +0200, Andrey Voropaev wrote: > > if [ 0 -eq $UID ] > > The variable UID is not defined to be automatically set by the shell in > POSIX; having it set is a bash extension.  dash doesn't set it > automatically for you. > > You'll

Re: dash drops exported bash functions

2016-02-11 Thread Stephane Chazelas
2016-02-11 15:30:59 +0100, Makarius: [...] > The problem is a deeper one, though: export -f in bash no longer > works for systems that have /bin/sh -> dash (i.e. Debian and > Ubuntu). [...] Note that pdksh/posh/mksh also strip those variables which it can't map to shell variable names (and have fo

Re: dash: read does not ignore trailing spaces

2015-12-03 Thread Stephane Chazelas
2015-12-03 23:17:58 +, Stephane Chazelas: > 2015-12-03 23:04:31 +0000, Stephane Chazelas: > [...] > > > Summarising: POSIX states that "each occurrence in the input of an IFS > > > character that is not IFS white space, along with any adjacent IFS white >

Re: dash: read does not ignore trailing spaces

2015-12-03 Thread Stephane Chazelas
2015-12-03 23:04:31 +, Stephane Chazelas: [...] > > Summarising: POSIX states that "each occurrence in the input of an IFS > > character that is not IFS white space, along with any adjacent IFS white > > space, shall delimit a field". This *may* be interpreted

Re: dash: read does not ignore trailing spaces

2015-12-03 Thread Stephane Chazelas
2015-12-03 22:43:39 +0100, Martijn Dekker: > Stephane Chazelas schreef op 03-12-15 om 22:17: > > It's meant to split into "a" and "b", not "a", "b" and "". As > > ":" is meant to be treated as a *delimiter* or *termi

Re: dash: read does not ignore trailing spaces

2015-12-03 Thread Stephane Chazelas
2015-12-03 22:02:14 +0100, Harald van Dijk: [] > $ for shell in bash mksh posh zsh; do printf %s: "$shell"; $shell > -c 'IFS=,; echo a, | { read v; echo "<$v>"; }'; done > bash: > mksh: > posh: > zsh: > > As far as I can tell, the posh/zsh behaviour is the correct > behaviour, but I'

Re: [BUG] dash uses $* instead of $@ in variable assignments

2015-11-26 Thread Stephane Chazelas
2015-11-26 20:44:26 +0100, Gioele Barabucci: > Hello, > > I am forwarding a bug [1] reported by a Debian user: dash incorrectly > uses `$*` instead of the requested `$@` inside variable assignments. > The current version of dash is affected by this bug. > > A simple test from the original reporte

Re: [bug?] echo -n does not work as described

2015-11-12 Thread Stephane Chazelas
2015-11-11 22:46:02 -0500, Kevin Korb: [...] > >>> NOTE: your shell may have its own version of echo, which > >>> usually super‐ sedes the version described here. Please refer > >>> to your shell's docu‐ mentation for details about the options > >>> it supports. > > > >> By the way, 'echo -n' is n

Re: [BUG] ${#var} returns length in bytes, not characters

2015-06-03 Thread Stephane Chazelas
2015-06-03 13:29:33 +0200, Martijn Dekker: > POSIX: > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 > > ${#parameter} > > String Length. The length in characters of the value of parameter > > shall be substituted. [...] > > dash does not expand the length in

Re: Bug#501566: [MAN] Clarify two redirection mechanisms

2014-12-09 Thread Stephane CHAZELAS
2014-12-08 22:22:03 +0100, Stéphane Aulery: > Le lundi 08 décembre 2014 à 08:37:38, Stephane CHAZELAS a écrit : > > 2014-12-08 19:50:05 +0100, Stéphane Aulery: > > >>>> [n1]>&n2Redirect standard output (or fd n1) to the same "open > > &

Re: Bug#501566: [MAN] Clarify two redirection mechanisms

2014-12-08 Thread Stephane CHAZELAS
2014-12-08 19:50:05 +0100, Stéphane Aulery: [n1]>&n2Redirect standard output (or fd n1) to the same "open file description" as on fd n2. [n1]>&n2Copy fd n2 as stdout (or fd n1) [n1]>&n2Redirect standard output (or fd n1) to the same

Re: [MAN] Clarify two redirection mechanisms

2014-12-01 Thread Stephane Chazelas
2014-12-01 18:04:56 +0800, Herbert Xu: [...] > > --- a/src/dash.1 > > +++ b/src/dash.1 > > @@ -402,11 +402,13 @@ Append standard output (or n) to file. > > .It [n] Ns \*[Lt] file > > Redirect standard input (or n) from file. > > .It [n1] Ns \*[Lt]& Ns n2 > > -Duplicate standard input (or n1) from f

command substitutions in $PS4

2014-11-17 Thread Stephane Chazelas
Hello. [tested on current git head f6d4def4e27b13fab174e948b94cd10550d3e10e] Command substitution doesn't seem to work in $PS4 (used for xtrace prompt): $ PS4='$(date +%T)> ' dash -xc : dash: 1: Syntax error: end of file unexpected (expecting ")") And with the old syntax: $ PS4='`date +%T`> '

Re: Bug#501566: dash: details of redirection/duplication in manpage are reversed

2014-11-11 Thread Stephane Chazelas
2014-11-11 14:23:21 +0100, Stephen Shirley: [...] > "[n1]>&n2Redirect standard output (or n1) to n2." > > It doesn't cover the case where n2 is later changed, and how n1 does > not follow this, but it's the simplest fix i see. [...] That's ambiguous. Maybe: [n1]>&n2Redirect standard out

Re: % in $PATH

2014-11-10 Thread Stephane Chazelas
2014-11-10 23:39:51 +0100, Guido Berhoerster: [...] > That leaves the /path%func > case but there is precendence with FPATH as a solution if "%" is > to be completely eliminated from PATH. [...] Where ash's $PATH handling is superior to $FPATH is that you can specify which fpath component has prec

Re: % in $PATH

2014-11-10 Thread Stephane Chazelas
2014-11-10 22:59:38 +0100, Guido Berhoerster: [...] > A much nicer solution would be to do something similar to the > original Korn shell and assign additional builtins a virtual > path which can be freely assigned in PATH and with which they can > be explicitly called. No more "%" in PATH and the

Re: % in $PATH

2014-11-10 Thread Stephane Chazelas
2014-11-10 21:20:02 +0800, Herbert Xu: > On Wed, Nov 05, 2014 at 11:59:47AM +0000, Stephane Chazelas wrote: > > Hello, > > > > ash/dash have a nice feature that allows to have: > > > > PATH=/bin:%builtin:/usr/bin:/some/dir%func:/sbin > > > >

% in $PATH

2014-11-05 Thread Stephane Chazelas
Hello, ash/dash have a nice feature that allows to have: PATH=/bin:%builtin:/usr/bin:/some/dir%func:/sbin To have commands in /bin take precedence over builtins and files in /some/dir being looked up for autoloaded functions (a bit like FPATH in ksh/zsh). That's nice but the way it is implement

Re: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty

2014-10-20 Thread Stephane Chazelas
2014-10-08 15:26:36 +0800, Herbert Xu: > commit 3c06acdac0b1ba0e0acdda513a57ee6e31385dce > Author: Herbert Xu > Date: Wed Oct 8 15:24:23 2014 +0800 > > [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty > > Currently we do not field-split $@/$* when it isn't quoted a

Re: Dashhh

2011-11-18 Thread Stephane CHAZELAS
2011-11-17, 13:38(-07), Eric Blake: [...] >> sed 's/^[[:blank:]]*\([^[:blank:]]*\)[[:blank:]]*()[[:blank:]]*{/& loca= > l FUNCNAME=3D\1;/' > > Except that 'local' is not part of POSIX, so while this conversion may > work for dash, it's not a portable catch-all for other compliant shells. [...] Tho

Re: Dashhh

2011-11-17 Thread Stephane CHAZELAS
2011-11-17, 17:17(+01), Heiko Gerstung: [...] > 1. The usual "[[" and "==" stuff (pretty easy to change, thank you sed) > 2. shift returns with a critical error when no arguments are left (no really > good solution found) [ "$#" -eq 0 ] || shift > 3. $[] arithmetic stuff not working (OK, worked

Re: [PATCH] echo: fix octal escaping with \1...\7

2011-10-31 Thread Stephane CHAZELAS
2011-10-31, 07:35(-06), Paul Gilmartin: > On Oct 31, 2011, at 07:12, Eric Blake wrote: > >> [adding bug-libtool] >> > [removing, because I'm not registered.] > >> On 10/30/2011 10:23 PM, Mike Frysinger wrote: >>> On Sunday 30 October 2011 23:41:58 Herbert Xu wrote: Mike Frysinger wrote:

Re: [PATCH] echo: fix octal escaping with \1...\7

2011-10-26 Thread Stephane CHAZELAS
2011-10-25, 17:58(-04), Mike Frysinger: > POSIX states that octal escape sequences should take the form \0num > when using echo. Only with the XSI option (Unix), for POSIX, echo "\whatever" is unspecified. But as far as I can tell even with XSI, "echo '\123'" is unspecified as well, so dash is fre