[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Ash internal 'read' command and pipes
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2013-10-12 1:36:40
Message-ID: 201310120336.40165.vda.linux () googlemail ! com
[Download RAW message or body]

On Wednesday 09 October 2013 17:51, Laurent Bercot wrote:
> 
> > you will see the values of your variables doesn't change when
> > commands run in a subshell ... and piping informations always
> > means passing data between separate processes, so it forces the
> > command to be run in its own subshell.
> 
>   You have to admit that it is not intuitive or user-friendly, to
> say the least. It goes against the principle of least surprise :
> the shell behaviour changes depending on something that is not
> at all immediately obvious to the user, and worse, that the shell
> language is actively trying to hide : subshells are forked silently,
> as if it was something shameful - and considering the hefty amount
> of resources used in forking a shell, *it is*; but it is not so
> silent when users experience bugs because running a command in the
> main shell is not the same thing as running it in a subshell.

Shell wasn't meant to be a general purpose programming language.
I suppose it started as a means to run a few commands in sequence,
then it grew more features as necessary.

The end result is a quite awkward language. For one: which other
language would care about whitespace in assignment operations? -

a=b
a= b
a =b
a = b

In shells, only the first form is ok.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic