OT: Shell Script
Glenn Steen
glenn.steen at gmail.com
Wed Feb 8 16:11:36 GMT 2006
On 08/02/06, Tim Sailer <sailer at bnl.gov> wrote:
> On Wed, Feb 08, 2006 at 12:08:19PM +0100, Glenn Steen wrote:
> > On 07/02/06, Tim Sailer <sailer at bnl.gov> wrote:
> > (snip)
> > > for file in `echo *`
> > (snip)
> > Tim, just curious... Why do you go the "long route around" backticks
> > and an echo, just to use the same shell "wildcarding" mechanism as a
> > single "*" would give you?
> > That cannot be necessary... Just use an * and you'll be fine... As in
> > ...
> > for file in *
> > do
>
> Well, yes, for the most part. I guess I'm just showing my age, unix-wise.
> Back in the good old days with the standard Bourne shell, globbing didn't
> quite work like the present.
In the far reaches of my memory, I do beleive you might be right:-).
Not so any more though;).
> Plus, * by itself means a lot of things to
> the shells.
Not really;).
> Evaling the results of the 'echo -n' and '-n' by itself may
> have different results, if a file was created with the name '-n'.
Again, not really, at least not any more... If you're after
"pathifying" them, using ./* or a find would do the trick (only real
way of defeating "option-like" filenames)... Otherwise the -n filename
would be lost to the echo.
>
> Habit, I guess. After all these years, that sequence just flows off
> my fingertips...
I'm sure I do my share of "old crud typing" too... For years (hm, more
like "decade(s)", come to think of it) I was guilty of "the tripple
sync before shutdown" on systems that simply didn't need them...:-)
Thanks for the answer.
--
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se
More information about the MailScanner
mailing list