06-20-2012
thanks i got this works
---------- Post updated at 09:39 AM ---------- Previous update was at 09:24 AM ----------
Hi All,
I am using multiple for loop's in my script but it is running more than one loop. Don’t know where i am doing mistake. Please help me on this.
Code :
for f in `cat rdf2-dg.txt`
do
symrdf -g $f query >> /home/srdf-query-report.txt
done
cat /home/srdf-query-report.txt|grep -i "Remote Symmetrix ID"|awk '{print $5}'> /home/sid.txt
cat /home/srdf-query-report.txt|grep -i "DEV001"|awk '{print $7}' > /home/dev.txt
for g in `cat /home/sid.txt`
do
for h in `cat /home/dev.txt`
do
symmaskdb -sid $g -dev $h list assign |grep FA |head -1|awk '{print $2}' > tt1.txt
done
done
for i in `cat tt1.txt`
do
symmaskdb -sid $g -wwn $i list devs >> /home/srdf-query-report.txt
symmaskdb -sid $g -wwn $i list devs|grep "User-generated Name"|awk '{print $4}'|sed "s/[/][0-9]*//" >tt2.txt
done
for j in `cat tt2.txt`
do
for k in `cat /home/sid.txt`
symmaskdb -sid $k -host $j list capacity >> /home/srdf-query-report.txt
done
done
I should get out put like this
Code :
Device Group (DG) Name : ldnrod_dg
Code :
DG's Type : RDF2
DG's Symmetrix ID : R1-SID (Microcode Version: 5773)
Remote Symmetrix ID : R2-SID (Microcode Version: 5773)
RDF (RA) Group Number : 2 (01)
Target (R2) View Source (R1) View MODES
-------------------------------- ------------------------ ----- ------------
ST LI ST
Standard A N A
Logical T R1 Inv R2 Inv K T R1 Inv R2 Inv RDF Pair
Device Dev E Tracks Tracks S Dev E Tracks Tracks MDAE STATE
-------------------------------- -- ------------------------ ----- ------------
DEV001 0A7B WD 0 0 RW 071B RW 0 0 S... Synchronized
DEV002 0B03 WD 0 0 RW 0723 RW 0 0 S... Synchronized
DEV003 0B0B WD 0 0 RW 072B RW 0 0 S... Synchronized
DEV004 026B WD 0 0 RW 0733 RW 0 0 S... Synchronized
DEV005 0273 WD 0 0 RW 073B RW 0 0 S... Synchronized
Total -------- -------- -------- --------
Track(s) 0 0 0 0
MB(s) 0.0 0.0 0.0 0.0
Legend for MODES:
M(ode of Operation) : A = Async, S = Sync, E = Semi-sync, C = Adaptive Copy
D(omino) : X = Enabled, . = Disabled
A(daptive Copy) : D = Disk Mode, W = WP Mode, . = ACp off
(Consistency) E(xempt): X = Enabled, . = Disabled, M = Mixed, - = N/A
Symmetrix ID : R2-SID
Originator Port wwn : 10000000c9b21a36
User-generated Name : ldnrod/00
Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------
071B 3A:1 Not Visible 0 2 0 N/A (M) 136706
Symmetrix ID : R2-SID
Host Name : ldnrod
Identifiers Found : 10000000c9b21a37
10000000c9b21a36
10000000c9b20ede
10000000c9b20edf
Device Cap(MB) Attr Dir:P
------ ------- ---- ----
071B 136706 (M) 3A:1,14A:1
0723 136706 (M) 3A:1,14A:1
072B 136706 (M) 3A:1,14A:1
0733 136706 (M) 3A:1,14A:1
073B 136706 (M) 3A:1,14A:1
-----------------------------
MB Total: 683530
GB Total: 667.5
But Iam getting the out-put like below loop not getting ended.
Code :
Device Group (DG) Name : ldnrod_dg
DG's Type : RDF2
DG's Symmetrix ID : R1-SID (Microcode Version: 5773)
Remote Symmetrix ID : R2-SID (Microcode Version: 5773)
RDF (RA) Group Number : 2 (01)
Target (R2) View Source (R1) View MODES
-------------------------------- ------------------------ ----- ------------
ST LI ST
Standard A N A
Logical T R1 Inv R2 Inv K T R1 Inv R2 Inv RDF Pair
Device Dev E Tracks Tracks S Dev E Tracks Tracks MDAE STATE
-------------------------------- -- ------------------------ ----- ------------
DEV001 0A7B WD 0 0 RW 071B RW 0 0 S... Synchronized
DEV002 0B03 WD 0 0 RW 0723 RW 0 0 S... Synchronized
DEV003 0B0B WD 0 0 RW 072B RW 0 0 S... Synchronized
DEV004 026B WD 0 0 RW 0733 RW 0 0 S... Synchronized
DEV005 0273 WD 0 0 RW 073B RW 0 0 S... Synchronized
Total -------- -------- -------- --------
Track(s) 0 0 0 0
MB(s) 0.0 0.0 0.0 0.0
Legend for MODES:
M(ode of Operation) : A = Async, S = Sync, E = Semi-sync, C = Adaptive Copy
D(omino) : X = Enabled, . = Disabled
A(daptive Copy) : D = Disk Mode, W = WP Mode, . = ACp off
(Consistency) E(xempt): X = Enabled, . = Disabled, M = Mixed, - = N/A
Device Group (DG) Name : ldnrod_dg
DG's Type : RDF2
DG's Symmetrix ID : R1-SID (Microcode Version: 5773)
Remote Symmetrix ID : R2-SID (Microcode Version: 5773)
RDF (RA) Group Number : 2 (01)
Target (R2) View Source (R1) View MODES
-------------------------------- ------------------------ ----- ------------
ST LI ST
Standard A N A
Logical T R1 Inv R2 Inv K T R1 Inv R2 Inv RDF Pair
Device Dev E Tracks Tracks S Dev E Tracks Tracks MDAE STATE
-------------------------------- -- ------------------------ ----- ------------
DEV001 0A7B WD 0 0 RW 071B RW 0 0 S... Synchronized
DEV002 0B03 WD 0 0 RW 0723 RW 0 0 S... Synchronized
DEV003 0B0B WD 0 0 RW 072B RW 0 0 S... Synchronized
DEV004 026B WD 0 0 RW 0733 RW 0 0 S... Synchronized
DEV005 0273 WD 0 0 RW 073B RW 0 0 S... Synchronized
Total -------- -------- -------- --------
Track(s) 0 0 0 0
MB(s) 0.0 0.0 0.0 0.0
Legend for MODES:
M(ode of Operation) : A = Async, S = Sync, E = Semi-sync, C = Adaptive Copy
D(omino) : X = Enabled, . = Disabled
A(daptive Copy) : D = Disk Mode, W = WP Mode, . = ACp off
(Consistency) E(xempt): X = Enabled, . = Disabled, M = Mixed, - = N/A
Symmetrix ID : R2-SID
Originator Port wwn : 10000000c9b21a36
User-generated Name : ldnrod/00
Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------
071B 3A:1 Not Visible 0 2 0 N/A (M) 136706
Symmetrix ID : R2-SID
Originator Port wwn : 10000000c9b21a36
User-generated Name : ldnrod/00
Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------
071B 3A:1 Not Visible 0 2 0 N/A (M) 136706
Symmetrix ID : R2-SID
Originator Port wwn : 10000000c9b21a36
User-generated Name : ldnrod/00
Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------
071B 3A:1 Not Visible 0 2 0 N/A (M) 136706
Symmetrix ID : R2-SID
Originator Port wwn : 10000000c9b21a36
User-generated Name : ldnrod/00
Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------
071B 3A:1 Not Visible 0 2 0 N/A (M) 136706
Last edited by vbe; 06-20-2012 at 12:33 PM ..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a huge file where the each column has data in the format:
. I want to remove the from each value. How do I do it with sed?
thanks (2 Replies)
Discussion started by: manishabh
2 Replies
2. Shell Programming and Scripting
Hello Experts,
I have a file "tt.txt" which is like:
#a1=a2
b1=b2
#c1=c2
I need to remove the pound (#) sign from a particular line. In this case let us assume it's 3rd line : "#c1=c2"
I can do it through:
sed "s/#c1=c2/c1=c2/" tt.txtbut it is possible that I may not know the value... (6 Replies)
Discussion started by: hkansal
6 Replies
3. Shell Programming and Scripting
Hi...
i need a script to remove the space before and after the operator like( / ).
Ex :
Input file
apple / manago
mango / fresh apple / fresh
Desired output:
apple/manago
mango/fresh apple/fresh
Note: betwee the desired operator space should be removed, between words do not remove... (3 Replies)
Discussion started by: vasanth_vadalur
3 Replies
4. Shell Programming and Scripting
Hello!
Please bare with me, I'm a total newbie to scripting. Here's the sudo code of what I'm trying to do:
Get file name
Does file exist?
If true
get length of file name
get network id (this will be the last 3 numbers of the file name)
loop x 2
If... (1 Reply)
Discussion started by: KatieV
1 Replies
5. Shell Programming and Scripting
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies
6. Shell Programming and Scripting
Below i am trying to remove "/" and "r" from the output, so i need output as:
hdiskpower3
hdisk0
hdisk1
#inq | grep 5773 | awk '{print $1}' | sed 's/dev//g' | awk -F"/" '{$1=$1}1'
.....................................................//rhdiskpower0
//rhdiskpower1
//rhdiskpower2... (3 Replies)
Discussion started by: aix_admin_007
3 Replies
7. Shell Programming and Scripting
Hi
I need help on this ..!!
Input :
xx_abc_regA
xx_def_regB
xx_qwe_regC
Now i required the output as the below
abc
def
qwe
Need to remove last occurrence of character (_) and rest of the string in Unix (sed).
Thanks in Advance ..!!!
-Nallachand (3 Replies)
Discussion started by: Nallachand
3 Replies
8. Shell Programming and Scripting
hello.
How to remove all characters in a line from first character ( a $ ) until and including the third occurrence of that character ( $ ).
Any help is welcome. (10 Replies)
Discussion started by: jcdole
10 Replies
9. Shell Programming and Scripting
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Discussion started by: rak Kundra
8 Replies
10. Shell Programming and Scripting
Hi
I have file in below format. How i can remove the first and lost comma from this below file
,001E:001F,,,02EE,0FED:0FEF,
I need output has below
001E:001F,,,02EE,0FED:0FEF (6 Replies)
Discussion started by: ranjancom2000
6 Replies