cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting out tapes from TLD(32) and scratch pool

shekhar_Dohtre
Level 2
Certified

Hi All,

I need to get a list of tapes from the output below ,store it in a file called TLD55.list  & compare it with another file which has list of tapes to see if it has scrtach tapes from the TLD32.list ,if it has run bplabel -erase -m ${i} -d hcart1 -o -p scratch -host euroserver01  

on it .  So file one is output of vmquery  ,file 2 is output of VTL tapes.   8 is scracth pool id below. 

If you could help me just getting first column of tapes from the output below which has TLD32 in 4th column - It would be good help . Thanks

[root@server-europe01 Erase]# vmquery -bx -p 8 | grep -i 32 | more                                            

Z50004  HCART2    TLD     01       4     -     000_00032_    -          19     09/15/2012 09:36     --- ---   scratch
Z50005  HCART2    TLD     01       5     -     000_00032_    -           6     09/11/201209:25     --- ---   scratch
Z50014  HCART2    TLD     01      14     -     000_00032_    -          33     09/12/2012 08:46     --- ---   scratch
 

1 ACCEPTED SOLUTION

Accepted Solutions

mph999
Level 6
Employee Accredited
First column vmquery -bx -p 8 | grep -i 32 |awk '{print $1}' If for any reason you want multiple columns the {print $1 " " $2 " " $3}' I'd sort the output so vmquery -bx -p 8 | grep -i 32 |awk '{print $1}' |sort -n >file1 Sort the other file you make with sorn -n >file2 Then sdiff file1 file2 Entries in the output marked | are in both files marked < would only be in file1 (the first file specified) and marked > would only be in file2

View solution in original post

2 REPLIES 2

mph999
Level 6
Employee Accredited
First column vmquery -bx -p 8 | grep -i 32 |awk '{print $1}' If for any reason you want multiple columns the {print $1 " " $2 " " $3}' I'd sort the output so vmquery -bx -p 8 | grep -i 32 |awk '{print $1}' |sort -n >file1 Sort the other file you make with sorn -n >file2 Then sdiff file1 file2 Entries in the output marked | are in both files marked < would only be in file1 (the first file specified) and marked > would only be in file2

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

I have nothing to add to Martin's excellent response.

Just wondering - how many robots in this environment??
(big eyes...)