bug-bash
[Top][All Lists]
Advanced

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

Re: Unfamiliar; what does this do: "for file do"..."done"


From: L. A. Walsh
Subject: Re: Unfamiliar; what does this do: "for file do"..."done"
Date: Sat, 13 Aug 2016 09:16:00 -0700
User-agent: Thunderbird



Dennis Williamson wrote:

There's an implied in "$@"

for file in "$@"

----
Hmmm...interesting,
thanks,

From a very narrow perspective, it doesn't seem very common.  ;-)

Re: Chet
---
Yeah saw that... I think my brain blocked that instance out
because it's the sorta the exact opposite of what can be left
out in perl where you can leave off the var, but not the list,
i.e.

  for ( @ARRAY_NAME ) {
    ...
  }
so for looping over params using the default index var:
  for (@_) {...}

If only perl and/or bash both had default index & params, then
we could encounter a simple:
 for {...}

and have it all implicit... ;-)







reply via email to

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