1752777 Members
6060 Online
108789 Solutions
New Discussion юеВ

Re: Script question

 
SOLVED
Go to solution
harry d brown jr
Honored Contributor

Re: Script question

see attached perl script. Simple and straight forward, though not too elegant.

live free or die
harry
Live Free or Die
Sridhar Bhaskarla
Honored Contributor

Re: Script question

Raj,

Got it..

Look at this

vgfile is your VGfile
inq.out is your syminq.out
Look at out file after running this script.

---start of the script

while read LINE
do
#you may need to modify the following if your sample changes

INQ=`echo $LINE |awk '{print $6}'|cut -b 3-5`


while read vgline
do
echo $vgline |grep $INQ > /dev/null 2>&1
if [ $? = 0 ]
then
VG=`echo $vgline|awk '{print $1}'`
echo $LINE $VG >> out
fi
done < vgfile

done < inq.out

---end of the script----

See if it works...


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Rodney Hills
Honored Contributor

Re: Script question

Ya know, with all these scripts, it would sure help if our replies didn't have the preceding spaces removed so that proper indenting could be kept for readability.

My 2 cents

-- Rod Hills
There be dragons...
Roger Baptiste
Honored Contributor

Re: Script question

Thanks for the variety of script solutions. Didn't yet get a chance to go through all of them. I thought Procura's script was slick.
(procura: i made one change replacing the \d\d\d with \w\w\w , since the search is from 0-F and not just decimals).
I will assign points later during the day;

cheers
-raj
Take it easy.
Carlos Fernandez Riera
Honored Contributor

Re: Script question

Well if you have syminq yet.... I know it as inq.HP. The unsupported Charlys tools Collection...


Try these.... Two shs.


1- first file.sh : run on each box connected to symmetrix

2- put all files.dat in a box.

3- Edit file2.sh and change box1 by hostname. etc.

change email address
4- Run file2.sh


SEE SOURCE FIRST.

unsupported
Carlos Fernandez Riera
Honored Contributor

Re: Script question

The second...
unsupported
Ceesjan van Hattum
Esteemed Contributor

Re: Script question

Hi RaiMan,

It seems that you're already satisfied with some answers. I did not see your comment and no assigned points while i was working out an effective script.
Although my solution is a bit late, i post my solution, because it is really simple:

while read x
do
vg=`echo $x |cut -f1 -d' '`
for i in $x
do
awk -v vg=$vg /$i/'{print $0" "vg}' file2
done

done < file1

..where file1 is the vg-file and file2 the device-file. It simply search xxx in the big file, and prints with vg-name.
Maybe not the price for beautiness, but effective it s.

Regards,
Ceesjan
Roger Baptiste
Honored Contributor

Re: Script question

Carlos, the script looks intresting. I will check it up and get back with feedback/points. Ditoo to Ceesjan (even though it is much straightforward ;-) )

thanks
Take it easy.
chandoo
New Member

Re: Script question

Hi All

Thanks for the valuable information.
I have a situation.
we have emc symmetrix,
all my servers are looking at all the disks and devices.
If we expand a file system on Server A, we are in a situation of over-writing file system on server B or C or D .
I am figuring it out on how to use disks that are not used on any server while expanding the existing file systems or creating new file systems.
Can any one give me some comments.
my email id is chandra.sekhar@ipaper.com
Love to work on UNIX