I have a out from a command i need to grep a report. For that i need loop 3 variable for that. How i can loop need help.
HTML Code:
Symmetrix ID : 123456
Masking View Name : Host16
Last updated at : 04:13:06 PM on Thu Mar 17,2011
Initiator Group Name : Host16
Host Initiators
{
IG : ig-01
IG : ig-02
}
Port Group Name : Host16
Director Identification
{
FA-5F:1
FA-6F:1
}
Storage Group Name : Host16
Sym Dev Host
Name Dir:P Physical Device Name Lun Attr Cap(MB)
------ ----- ----------------------- ---- ---- -------
0F44 05F:1 Not Visible 0 (M) 34526
06F:1 Not Visible 0 (M)
0F47 05F:1 Not Visible 1 (M) 34526
06F:1 Not Visible 1 (M)
10C1 05F:1 Not Visible 8 (M) 34526
06F:1 Not Visible 8 (M)
10C3 05F:1 Not Visible 9 (M) 34526
06F:1 Not Visible 9 (M)
10C5 05F:1 Not Visible a (M) 34526
06F:1 Not Visible a (M)
10C7 05F:1 Not Visible b (M) 34526
06F:1 Not Visible b (M)
1280 05F:1 Not Visible e (M) 34526
06F:1 Not Visible e (M)
I want to loop
Code:
#To get Masking view and FA port
for f in `cat /home/DG-Group-Script/brick-sid-vmax.txt`
do
for g in `cat /home/DG-Group-Script/IG-vmax.txt`
do
symaccess -sid $f show view $g |grep "FA-"|head -1|sed -e "s/FA-//" > /home/DG-Group-Script/fa-port.txt
for i in `cat /home/DG-Group-Script/fa-port.txt`
do
echo $g-Masking View >>/home/DG-Group-Script/brick-dg-VMAX-report.txt
symaccess -sid $f show view $g |grep -i "$i"|awk '{print $1}' >> /home/DG-Group-Script/brick-dg-VMAX-report.txt
symaccess -sid $f show view $g |grep -i "$i"|awk '{print $1}' >/home/DG-Group-Script/222.txt
echo ****"DG-Group $f Vs Masking View Capacity $n"**** >> diff-report.txt
diff /home/DG-Group-Script/111.txt /home/DG-Group-Script/222.txt >> diff-report.txt
done
done
done
Hi Guys,
I have a scripts that uses a while loop to read a file and set 2 variables.
How can I do this so the variables can be used outside the while loop ?
Below is an example....# ./junk2 -m -e user
EXE=user master=TRUE
DB_TAG=PRODUCT
In loop MST=MST=testsvr1:3110
In loop ARGS=... (2 Replies)
Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it.
To make a long story short around 20K pieces of... (2 Replies)
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Hi, say I have a simple sh script like this:
for i in a b c d
do
for j in 1 2 3 4
do
echo "$i $j"
done
done
and the output is
a 1
a 2
a 3
a 4
b 1 (20 Replies)
Can we assign two variables in a for loop?
I have an input file:
000301|20100502
835101|20100502
I want to read this file in a for loop and assign values to two different variables.
I did this now but did not work
for STORE,RUNDATE in `awk -F\| '{print $1,$2}' inputfile
... (4 Replies)
Hi,
I need help on for loop need to add domain and IP
In domain list
1.com
2.com
3.com
In Ip list
1.1.0.1
1.2.0.1
1.3.0.1
1.com 1.1.0.1
2.com 1.2.0.1
3.com 1.3.0.1
I need to excute this command (4 Replies)
Greetings. I'm completely new to shell scripting and quickly trying to catch on. Here's my scenario:
I have a text file, named ip.txt, containing IP addresses. I want to automatically perform a whois query on each address in the file, search the output for the country, and then put both the IP... (4 Replies)
i am having a file contants as below
my requirement is
for file in `awk -F "," '{print $8,$9}'` <temp.txt
echo "$file"
echo "$file">test.txt
a=`awk -F "," '{print $1}' `<test.txt
b=`awk -F "," '{print $2}' `<test.txt
but script reads , i want both the vales for further... (5 Replies)
I am pretty new to Unix. Trying to pick up some slack while a coworker is out on vacation.
Basically the script is working fine however when I go through the testing phase and have to make mods it is a pita.
Here is an example of what I have
#!/bin/ksh
if
then
echo... (8 Replies)
Hello, please assist:
users="test1 test2"
keytest1="abcd"
keytest2="dbcd"
for i in $users
do
echo "$key${i}" > fileout
done
So, my objective is to take the current user (ie test1) in loop and echo its associated keyname (ie keytest1) variable to a file.
The echo... (2 Replies)
Discussion started by: motdman
2 Replies
LEARN ABOUT PHP
imagegrabwindow
IMAGEGRABWINDOW(3) 1 IMAGEGRABWINDOW(3)imagegrabwindow - Captures a windowSYNOPSIS
resource imagegrabwindow (int $window_handle, [int $client_area])
DESCRIPTION
Grabs a window or its client area using a windows handle (HWND property in COM instance)
PARAMETERS
o $window_handle
- The HWND window ID.
o $client_area
- Include the client area of the application window.
RETURN VALUES
Returns an image resource identifier on success, FALSE on failure.
ERRORS /EXCEPTIONS
E_NOTICE is issued if $window_handle is invalid window handle. E_WARNING is issued if the Windows API is too old.
EXAMPLES
Example #1
imagegrabwindow(3) example
Capture a window (IE for example)
<?php
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$im = imagegrabwindow($handle);
$browser->Quit();
imagepng($im, "iesnap.png");
imagedestroy($im);
?>
Capture a window (IE for example) but with its content
<?php
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://www.libgd.org");
/* Still working? */
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
imagedestroy($im);
?>
NOTES
Note
This function is only available on Windows.
SEE ALSO imagegrabscreen(3).
PHP Documentation Group IMAGEGRABWINDOW(3)