On 29 Jan 2018 14:41, Denys Vlasenko wrote:
> On Mon, Jan 29, 2018 at 6:43 AM, Mike Frysinger wrote:
> > On 28 Jan 2018 19:17, Denys Vlasenko wrote:
> >> On Fri, Jan 26, 2018 at 7:50 PM, Mike Frysinger wrote:
> >> > On 26 Jan 2018 15:15, Denys Vlasenko wrote:
> >> >> On Fri, Jan 26, 2018 at 9:34 AM, Paul Otto wrote:
> >> >> > This patch restores, and improves upon, expected behavior to BASH
> >> >> > compatibility which was lost beginning with 1.27.0. This was pulled 
> >> >> > into
> >> >> > Alpine 3.7 which, in turn was pulled into official Docker images 
> >> >> > beginning
> >> >> > with docker:17.12. As a result, a large number of CICD builds that use
> >> >> > "source filename" have broken everywhere.
> >> >> >
> >> >> > According to the BASH documentation, the source command should:
> >> >> > Read and execute commands from filename  in  the  current  shell 
> >> >> > environment
> >> >> > and return the exit status of the last command executed from 
> >> >> > filename.  If
> >> >> > filename does not contain a slash, filenames  in  PATH  are used to 
> >> >> > find the
> >> >> > directory containing filename.  The file searched for in PATH  need  
> >> >> > not  be
> >> >> > executable. When  bash  is  not  in  posix  mode,  the  current 
> >> >> > directory is
> >> >> > searched if no file is found in PATH.
> >> >>
> >> >> I wish bash wouldn't introduce gratuitous standard violations.
> >> >
> >> > bash is its own shell.  why can't it introduce its own extensions as it 
> >> > sees
> >> > fit ?
> >>
> >> Because a divergence is not a good thing, especially if it's gratuitous
> >
> > this position makes no sense.  are you saying that no shell should be 
> > allowed
> > to extend the syntax however it wants ?  every shell out there should only 
> > be
> > allowed to implement POSIX and nothing else ?
> 
> The extensions which add some significantly useful functionality are ok.
> Example: arrays.
> 
> Changes which don't really add such functionality do more harm than good.
> Example: "function" keyword in bash made it possible to do this:

in general, i think you're applying 20/20 hindsight to things.  it's easy to
say something is a bad idea years after the fact with experience in hand.

also, i don't think the function keyword originated in bash.  the internet
suggests it originated in the korn shell and was picked up by other shells.

also, i know you know this, but POSIX isn't a spec that leads the real world.
it exists based on the corpus of existing implementations, including new
functions and features.  so unless people try out new things and get others
to adopt them, then POSIX isn't going to change either.  that includes trying
things that fail.

> f() { echo "Good"; }
> function g { echo "Your script is now not posix compatible,
> congratu-effing-lations"; }

some people like that extra syntatic sugar because it makes scanning code
and identifying functions easier (to their eyes).  i've met a few people
now who argue you should always keep the "function" keyword.
-mike

Attachment: signature.asc
Description: Digital signature

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to