Re: In defence of compound aliases

2019-01-15 Thread Robert Elz
Date:Wed, 16 Jan 2019 05:20:12 +0700 From:Robert Elz Message-ID: <27785.1547590...@jinx.noi.kre.to> | magnolia$ echo $BASH_VERSION | 4.4.12(1)-release Just realised I was using a system with an older bash than I do have available here for that test, on a newer

Re: In defence of compound aliases

2019-01-15 Thread Harald van Dijk
On 15/01/2019 23:04, Robert Elz wrote: Date:Tue, 15 Jan 2019 20:38:15 + From:Harald van Dijk Message-ID: | On 15/01/2019 15:13, Joerg Schilling wrote: | > would make it she slowest shell in the universe. | parser as well. Testing on its own

Re: In defence of compound aliases

2019-01-15 Thread Chet Ramey
On 1/15/19 5:20 PM, Robert Elz wrote: > As for which shells don't do it, or do it differently, .well, bash is one ... > > magnolia$ echo $BASH_VERSION > 4.4.12(1)-release > magnolia$ alias foo='echo "x' > magnolia$ foo bar" > x bar > magnolia$ > > Notice two spaces between the 'x' and 'bar'

Re: In defence of compound aliases

2019-01-15 Thread Robert Elz
Date:Wed, 16 Jan 2019 05:20:12 +0700 From:Robert Elz Message-ID: <27785.1547590...@jinx.noi.kre.to> | ksh93, bosh, mksh, pdksh, all give the same results. And yash, forgot to test that one earlier. I also forgot zsh, but whatever it is doing (with --emulate sh or

Re: In defence of compound aliases

2019-01-15 Thread Robert Elz
Date:Tue, 15 Jan 2019 20:38:15 + From:Harald van Dijk Message-ID: | On 15/01/2019 15:13, Joerg Schilling wrote: | > would make it she slowest shell in the universe. | parser as well. Testing on its own configure script, yes, there are | faster shells,

Re: In defence of compound aliases

2019-01-15 Thread Harald van Dijk
On 15/01/2019 11:15, Joerg Schilling wrote: Harald van Dijk wrote: Can there be an alternative rewording that specifies the behaviour in even more cases, where the resulting text is still both correct and understandable, and the extra cases are verified to work the same way on all current

Re: In defence of compound aliases

2019-01-15 Thread Harald van Dijk
On 15/01/2019 11:03, Joerg Schilling wrote: Harald van Dijk wrote: On 14/01/2019 13:32, Joerg Schilling wrote: posh does not work on platforms with a POSIX compliant getopt(), so there are other reasons not to take posh into account. This is misleading. There are platforms with a POSIX

Re: In defence of compound aliases

2019-01-15 Thread Stephane CHAZELAS
2019-01-15 17:19:24 +0100, Joerg Schilling: [...] > > Note that even UNIX (POSIX+XSI) certified systems are not > > compliant. For instance, macOS "/bin/echo" doesn't expand \n, > > \b... as POSIX+XSI requires. > > AFAIR, Apple did compile bash (like Sun did for Solaris) in a way that does > not

Re: In defence of compound aliases

2019-01-15 Thread Stephane CHAZELAS
2019-01-15 17:19:24 +0100, Joerg Schilling: [...] > > I don't think GNU/Debian systems care about XSI, or the UNIX > > trademark either. AFAICT, they concern themselves with the POSIX > > base, and pick XSI extensions when they are useful (and don't > > break their own backward compatibility). >

Re: In defence of compound aliases

2019-01-15 Thread Joerg Schilling
Stephane CHAZELAS wrote: > > Note that XSI enhancements only may be omitted in case of a UNIX system for > > embedded use. So this is a similar problem as the missing multi byte > > support in > > "dash" that only would be permitted if dash was used on embedded systems > > only. > [...] > >

Re: In defence of compound aliases

2019-01-15 Thread Joerg Schilling
Chet Ramey wrote: > > You seem to missunderstand me. > > Sure, OK. Frame it how you like. The question stands. If that is how > every existing alias implementation behaves, we should not argue about > adding that to the standard to tighten up the meaning of "the resulting > tokens shall replace

Re: In defence of compound aliases

2019-01-15 Thread Stephane CHAZELAS
2019-01-15 16:13:42 +0100, Joerg Schilling: > Stephane CHAZELAS wrote: > > > > posh is s non-POSIX that even normal tests return incorrect results > > > :-( > > > > "type" is not in the POSIX base (and as a result not in > > the Debian policy) > >

Re: In defence of compound aliases

2019-01-15 Thread Chet Ramey
On 1/15/19 10:14 AM, Joerg Schilling wrote: > Chet Ramey wrote: > >> Or are we hung up on the word "stack"? > > You seem to missunderstand me. Sure, OK. Frame it how you like. The question stands. If that is how every existing alias implementation behaves, we should not argue about adding that

Re: In defence of compound aliases

2019-01-15 Thread Joerg Schilling
Chet Ramey wrote: > Or are we hung up on the word "stack"? You seem to missunderstand me. Jörg -- EMail:jo...@schily.net(home) Jörg Schilling D-13353 Berlin joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL:

Re: In defence of compound aliases

2019-01-15 Thread Joerg Schilling
Stephane CHAZELAS wrote: > > posh is s non-POSIX that even normal tests return incorrect results :-( > > "type" is not in the POSIX base (and as a result not in > the Debian policy) http://pubs.opengroup.org/onlinepubs/9699919799/utilities/type.html First added with issue 2, which seems to

Re: In defence of compound aliases

2019-01-15 Thread Chet Ramey
On 1/15/19 9:56 AM, Joerg Schilling wrote: > Chet Ramey wrote: > >> Which shells don't rescan the alias value in the lexer? AFAICT, that's one >> of the things everyone does the same way. > > A shell that did this would only be able to alias one word by one other word > and macros like > >

Re: In defence of compound aliases

2019-01-15 Thread Joerg Schilling
Chet Ramey wrote: > Which shells don't rescan the alias value in the lexer? AFAICT, that's one > of the things everyone does the same way. A shell that did this would only be able to alias one word by one other word and macros like alias ll='ls -l' would not work. I am not aware of

Re: In defence of compound aliases

2019-01-15 Thread Stephane CHAZELAS
2019-01-15 11:56:20 +0100, Joerg Schilling: [...] > OK: > > PATH=/ /opt/schily/bin/posh -c 'type' > /opt/schily/bin/posh: type: not found > > posh is s non-POSIX that even normal tests return incorrect results :-( "type" is not in the POSIX base (and as a result not in the Debian policy)

Re: In defence of compound aliases

2019-01-15 Thread Chet Ramey
On 1/15/19 9:05 AM, Robert Elz wrote: > | Again, why can't you agree on having the alias expansion work strictly at > the > | lexical level, prepending the expanded string to the input and rescanning > from > | the beginning? > > If the role here was to define how things should work,

Re: In defence of compound aliases

2019-01-15 Thread Robert Elz
Date:Tue, 15 Jan 2019 11:55:52 + From:"Schwarz, Konrad" Message-ID: | Although I understand Robert Elz's reservations with respect to macro expansion, | it remains a technique with a lot of bang for the buck I hope no-one (perhaps except you) read my

Re: In defence of compound aliases

2019-01-15 Thread Joerg Schilling
Harald van Dijk wrote: > Can there be an alternative rewording that specifies the behaviour in > even more cases, where the resulting text is still both correct and > understandable, and the extra cases are verified to work the same way on > all current shells? If there is, I suspect that

Re: In defence of compound aliases

2019-01-15 Thread Joerg Schilling
Harald van Dijk wrote: > On 14/01/2019 13:32, Joerg Schilling wrote: > > posh does not work on platforms with a POSIX compliant getopt(), so there > > are > > other reasons not to take posh into account. > > This is misleading. There are platforms with a POSIX compliant getopt() > on which it

Re: In defence of compound aliases

2019-01-15 Thread Joerg Schilling
Martijn Dekker wrote: > > posh > > $ type alias > > alias is a shell builtin > > Yes: > > $ ./posh -c 'alias' > posh: alias: not found > $ ./posh -c 'type alias' > ./posh: type: not found > > You're on Solaris, right? posh doesn't have 'type' either so you must be > running your

Re: [1003.1(2013)/Issue7+TC1 0000953]: Alias expansion is under-specified

2019-01-15 Thread Geoff Clare
Stephane Chazelas wrote, on 09 Jan 2019: > > I'd rather POSIX forbade applications to use "while", "until", > "do", "select", "time", etc in alias names, or leave it > unspecified whether aliases for those are expanded. I have updated bugnote 4201 to make this unspecified. -- Geoff Clare The

Re: [1003.1(2013)/Issue7+TC1 0000953]: Alias expansion is under-specified

2019-01-15 Thread Geoff Clare
I have made the changes below in bugnote 4201, and also the one that Harald spotted (removal of ", unlike the contents of a dot script"). Regards, Geoff. Geoff Clare wrote, on 09 Jan 2019: > > Robert Elz wrote, on 09 Jan 2019: > > > > There are just a couple of minor points that I have with