From: Josh Cheek Date: 2009-11-20T06:08:08+09:00 Subject: Re: For Loop --000e0cd254927a320d0478bfc1a7 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Nov 19, 2009 at 2:52 PM, Mike Stok wrote: > > For Ruby, I tried - > > > > for group in Account File", > > "Bank File", > > "Study Case", > > "Overall Status" > > do > > (scp groups user@server1:/tmp) > > end > > > > Of course, I get syntax errors everywhere. I am not sure how to use a > > for loop in this case. Any input? > > [ "Account File", "Bank File", "Study Case", "Overall Status" ].each do > |group| > puts "processing #{group}" > end > Some alternative syntax that might be more comfortable: for group in [ "Account File", "Bank File", "Study Case", "Overall Status" ] puts "processing #{group}" end for group in "Account File, Bank File, Study Case, Overall Status".split(", ") puts "processing #{group}" end --000e0cd254927a320d0478bfc1a7--