![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| if statements | pwanda | UNIX for Advanced & Expert Users | 4 | 11-02-2008 07:47 PM |
| for i loop with conditional statements? | xgringo | Shell Programming and Scripting | 2 | 12-13-2007 04:16 PM |
| Else in If Statements | chapmana | UNIX for Dummies Questions & Answers | 8 | 11-30-2006 08:07 AM |
| or statements? | Blip | Shell Programming and Scripting | 1 | 01-19-2004 04:08 PM |
| if statements | lilas | UNIX for Dummies Questions & Answers | 2 | 03-22-2001 11:49 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
is that possible to keep statements in any loop??
Hi,
Actually i stored all validdisks in one array and corresponding partitions required for all individual disks in other array.. Example: Validdisks[$diskcnt]=dsk2 dsk3 dsk5 ValidPartition[$Partitioncnt]=4 4 3 Now i have to create domain.. Domain creation can be done by below commands: fs_setup -d /dev/disk/${Validdisks[0]}a -n ${cfsfailover_dmn} -m ${cfsfailover_mnt}" addvol /dev/disk/${Validdisks[$diskcnt]}h ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}g ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}b ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}a ${cfsfailover_dmn} But tricky is there in creating domain... Lets go first with Validdisk[0] element: ============================ By checking the elements in ValidPartition[$Partitioncnt] array,i need to create.. Since first element of ValidPartition[0]=4 means (we have to use a,b,g,h) Domain creation for one disk wil be as below: fs_setup -d /dev/disk/${Validdisks[0]}a -n ${cfsfailover_dmn} -m ${cfsfailover_mnt}" addvol /dev/disk/${Validdisks[$diskcnt]}b ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}g ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}h ${cfsfailover_dmn} And lets go with second element of validdisk[1] Now here By checking the elements in ValidPartition[1] here it has 4 so again domain creation for second disk must be as below: addvol /dev/disk/${Validdisks[$diskcnt]}a ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}b ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}g ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}h ${cfsfailover_dmn} And lets go with third element of Validdisk[2] Now here By checking the elements in ValidPartition[2] here it has 3 so use a,b,g only addvol /dev/disk/${Validdisks[$diskcnt]}a ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}b ${cfsfailover_dmn} addvol /dev/disk/${Validdisks[$diskcnt]}g ${cfsfailover_dmn} And note that, " fs_setup -d /dev/disk/${Validdisks[0]}a -n ${cfsfailover_dmn} -m ${cfsfailover_mnt}" that should be written only once for first disk.. Later on we have to use addvol statements...Could you please help me by doing this in KSH scripting..Is that possible to keep in for loop?? Please provide your inputs..Thanks,Mansa |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|