[GTALUG] bash quoting [was Re: Help need in bash]

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Fri Jun 1 14:44:37 EDT 2018


On Fri, Jun 01, 2018 at 01:14:45PM -0400, znoteer--- via talk wrote:
> > Le 1 juin 2018 à 11:10, Lennart Sorensen via talk <talk at gtalug.org> a écrit :
> > 
> > 
> [snip]
> > 
> > $ for f in "*.png"; do echo "$f"; done
> > a b c.png a.png b.png c.png
> > 
> > $ for f in "*.png"; do echo "$f"; done
> > *.png
> [snip]
> 
> I don't understand what's going on here.  The exact same command is giving two different results?  When I try this on my system, I don't get a single-line listing of the 4 files, but rather the result "*.png" as you did in the second run of the command above.  Is there a typo somewhere?  Did you mean for the two commands above to be the same?

Hugh was right.  I had a cut and paste error.

The first one was not supposed to have quites in the echo command.

-- 
Len Sorensen


More information about the talk mailing list