help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Learning Bash Shell Programming


From: Matthew Cengia
Subject: Re: [Help-bash] Learning Bash Shell Programming
Date: Sun, 2 Dec 2012 22:10:38 +1100
User-agent: Mutt/1.5.20 (2009-06-14)

On 2012-12-01 20:59, Chris F.A. Johnson wrote:
> On Tue, 27 Nov 2012, DJ Mills wrote:
> 
> >On Wed, Nov 21, 2012 at 2:12 PM, Hans-Juergen Becker <
> >address@hidden> wrote:
[...]
> >>http://tldp.org/LDP/abs/html/
[...]
> >Sorry to say it, but the "advanced" bash guide is the single largest
> >source of misinformation about bash out there.
> 
>    Have you looked at it recently?
> 
>    Can you point to one error?

Let's take http://tldp.org/LDP/abs/html/quoting.html as an example.
Nowhere in the quoting pages does it mention the use of $'blah' as a
quoting method, which been available since Bash 2. This is, of course an
omission rather than an error; and I should note that DJ doesn't
actually claim any "errors", but simply questions how "advanced" the
guide is.

> 
> >It's the reason you see so many people try to parse ls,
> 
>    There's nothing wrong with that, so long as you know what you're
>    doing.

Based on what I've seen in #bash, most people don't know what they're
doing. Despite being an "Advanced" guide, any newbie will read it and
take it on-board, including the deliberatly pathological (and bad)
examples (that aren't necessarily labelled as such), such as

  echo $(ls -l)

on the page I referenced above. I have no doubt that newbies read this
and try to parse ls poorly in other ways.

> 
> >or read a file line by line with 'for foo in $(cat file)',
> 
>    I wish I had a penny for every time I've corrected that in various forums!

I try to avoid fora for that reason (though I see it just as often in
#bash).

> 
> >or use unquoted expansions. The beginners guide you linked to first
> >actually has syntax errors in it, let alone the logic issues
> >everywhere.
> 
>   Examples?

I can't see any myself off-hand, but it's late and I didn't look too
closely.

> 
> >Unfortunately, I have yet to hear of the creator/maintainer responding to
> >any requests to update it or take it down.
> 
>   The Advanced guide had a major revision a while ago.

-- 
Regards,
Matthew Cengia

Attachment: signature.asc
Description: Digital signature


reply via email to

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