Hi clacke,

Your comment made me think about the way I have been using echo in this series. I may have said this at some point, but maybe not: I was primarily using it to demonstrate how expansion was working. I don't use it in that way to view directory contents and so forth.

Expansions like the ones here are used in many contexts, as you know. Back in my early days of using Unix (we had Sun, HP, DEC, Silicon Graphics and Apollo systems around at various times at the university I worked at), with a variety of shells. I think As an aside, I hated csh and tcsh the most!

There were time when I'd type something like:

rm *.msg

and get back an error like "too many files". That was because the expansion of '*.msg' resulted in 'rm' getting maybe thousands of file names, which it couldn't cope with. I got in the habit of doing stuff like:

echo *.msg | wc -w

to warn me of such potential problems. Maybe even 'echo' would fail sometimes with "too many files" (or similar), but I don't remember now. Maybe 'ls' would have been a better choice back then. However, for this series I felt it "got in the way" a bit more, as it were :-)

Your points about printf are well taken. I did mention it earlier in this series, and showed its use in various contexts. However, it probably deserves a show all of its own!

Yes, I had discovered:

$ printf "%s\n" *.msg

a while back and was surprised it printed out its arguments one per line. Some other 'printf' implementations reject such things because there are more arguments than format specifiers. The Bash 'printf' behaviour is better in my opinion.

Better stop - Ken will accuse me of wasting another show opportunity!