Quote:
Originally Posted by michaelk
|
Hi,
I used the bash arrays in following way and it is working now. Thanks
Script:
-bash-4.3$ cat vg_extend.sh
#!/bin/bash
#This script will extend the specified VG.
clear;
printf "Please enter the name of the vg that you want to extend: \t";
read VG_NAME;
echo "$VG_NAME will be extended.";
printf "Please enter the no. of new disks that will be assigned: \t";
read DISK_COUNT;
echo "You have entered $DISK_COUNT number of disks.";
for (( c=1; c<=$DISK_COUNT; c++ ))
do
printf "Enter disk name: \t";
read arr[$c];
done
echo "You have entered following disk names:";
for (( c=1; c<=$DISK_COUNT; c++ ))
do
echo ${arr[$c]};
done
Output:
Please enter the name of the vg that you want to extend: vg_gorkon
vg_gorkon will be extended.
Please enter the no. of new disks that will be assigned: 2
You have entered 2 number of disks.
Enter disk name: /dev/disk/disk248
Enter disk name: /dev/disk/disk249
You have entered following disk names:
/dev/disk/disk248
/dev/disk/disk249
BR,
Inderpal