[OT] shell variable assignment problemn

2008-05-30 Thread Gianluca Cecchi
Problem I'm able to understand: Suppose I have $NUMDISKS that can be 1 or 2 ... or n and $DISKS that can be sda, or sda sdb or sda sdb sdc (so a string with the didks separated by space) I want to assign DRIVE1=sda DRIVE2=sdb ... DRIVEN=sdn if I script for i in $(seq 1 $NUMDISKS) do

Re: [OT] shell variable assignment problemn

2008-05-30 Thread Luciano Rocha
On Fri, May 30, 2008 at 04:39:48PM +0200, Gianluca Cecchi wrote: Problem I'm able to understand: Suppose I have $NUMDISKS that can be 1 or 2 ... or n and $DISKS that can be sda, or sda sdb or sda sdb sdc (so a string with the didks separated by space) Personally, I'd go with arrays: