bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I think bash logic in a loop like : while [ condition] |read somevar


From: mrdue40
Subject: Re: I think bash logic in a loop like : while [ condition] |read somevar is flawed.
Date: Fri, 27 Dec 2013 16:27:43 -0800 (PST)
User-agent: G2/1.0

Ok,

fine with me greg.
did not expect everyone to get hot and bothered about this.

""If you want an interpreted programming language instead of a shell,
there are a bunch to choose from""

Did that. ksh. works the same and logical in any kind of unix or linux.


btw. 

POSIX is not 40 years old.
ksh never behaved this way.
I assume you are referring then to bsd sh or sunOS sh or similar.

thank you for your time, 

best regards


Rens


On Tuesday, December 24, 2013 7:56:32 PM UTC+1, Greg Wooledge wrote:
> On Tue, Dec 24, 2013 at 07:49:28PM +0100, rens wrote:
> 
> > I understand the technical origin of the behaviour.
> 
> > Spend +25 yrs in unix. I am so old, that I remember fighting (at my 
> 
> > 40th)  with linux 0.79, I think....
> 
> > 
> 
> > However, I am questioning if this is what a programming language should do.
> 
> 
> 
> Stop thinking of bash as a programming language.  It is a command shell.
> 
> 
> 
> Pipelines invoke multiple processes simultaneously.  That's their purpose:
> 
> to run a bunch of things in parallel, with linked input/output.  Each
> 
> process is just that -- a process.  A full-blown separate running program
> 
> with its own PID, its own private memory and file descriptors, and so on.
> 
> 
> 
> Moreover, the behavior of bash is constrained by 40+ years of unix shell
> 
> history.  It implements the feature set specified by POSIX, as well as
> 
> doing its best to be backwards compatible with older versions of itself,
> 
> and to a much smaller extent, with ksh and sometimes even csh.
> 
> 
> 
> If you want a shell that breaks out of that mold and does things in a
> 
> new way, then perhaps you want zsh.
> 
> 
> 
> If you want an interpreted programming language instead of a shell,
> 
> there are a bunch to choose from.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]