Awk command for search a string in lspv


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Awk command for search a string in lspv
# 1  
Old 09-23-2009
Lightbulb Awk command for search a string in lspv

I want to know wich hdisk have only one pvid and also display hdisk with two pvid.

hdisk1 00c3fcd4e516183f testvg active
hdisk2 00c3fcd4e516189b testvg active
hdisk3 00c3fcd4e51618ec testvg active
hdisk6 00c3fcd4e51618ec testvg active
hdisk8 00c3fcd4e516183f testvg active
# 2  
Old 09-23-2009
Something like this :

Code:
TESTBOX>sort -k2  file_name.txt | uniq -f1 -u
hdisk2 00c3fcd4e516189b testvg active

TESTBOX>sort -k2  file_name.txt | uniq -f1 -d
hdisk1 00c3fcd4e516183f testvg active
hdisk3 00c3fcd4e51618ec testvg active

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Lspv -free command on VIOS

Hi all, We have observed that lspv -free command tooks 15 to 20 minutes to display the free disks and we have only 77 MPIO disks on VIO Server. Our VIOS version is 2.2.1.4. Please let us know what could be the reason that lspv -free command taking long time to display the output. Thank (4 Replies)
Discussion started by: m_raheelahmed
4 Replies

2. Shell Programming and Scripting

Awk:String search more than one time and capture OP

Dear All During one of mine script developemnt i am stuch at one sub part. Requiremnt is as below kindly help me. IP file: 2015-02-28 10:10:15 AL M UtranCell UtranCell=RTE001X (unavailable) 2015-02-28 10:10:15 AL M UtranCell UtranCell=RTE001Y (unavailable) 2015-02-28 10:10:15 AL M... (6 Replies)
Discussion started by: jaydeep_sadaria
6 Replies

3. UNIX for Advanced & Expert Users

Pass variable to awk command search string

I must have forgot how to do this, but, I am attempting to enter a variable into an awk / gawk search pattern. I am getting a value from user input to place in a specific section of a 132 character string. my default command is .... gawk --re-interval '/^(.{3}P .{4}CYA.{8}1)/' ... (3 Replies)
Discussion started by: sdeevers
3 Replies

4. AIX

Lspv -free command on VIOS

Hi all, When we run lpsv -free command on VIOS, it will take lot of time to display free disks i.e around 8 to 10 minutes. VIOS ioslevel is 2.2.1.4Can you have any solution for this problem? Many Thanks (2 Replies)
Discussion started by: m_raheelahmed
2 Replies

5. Shell Programming and Scripting

Search string within a file and list common words from the line having the search string

Hi, Need your help for this scripting issue I have. I am not really good at this, so seeking your help. I have a file looking similar to this: Hello, i am human and name=ABCD. How are you? Hello, i am human and name=PQRS. I am good. Hello, i am human and name=ABCD. Good bye. Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies

6. Shell Programming and Scripting

Search several string and convert into a single line for each search string using awk command AIX?.

I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios. Cat test Nov 10, 2012 5:17:53 AM INFO: Request Type Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies

7. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

8. Shell Programming and Scripting

awk search between 2 digits a string

I would like to search between two a string. I thought this would be easy. The is always at the beginning of a line. The code: gawk '/^/{d=$1},/searchstring/,/^(d+1)/' or gawk '/^/,/searchstring/,/^/' did not return the desired result. inputfile.txt 999 some text searchstring some... (6 Replies)
Discussion started by: sdf
6 Replies

9. Shell Programming and Scripting

Awk - find string, search lines below string for other strings

What's the easiest way to search a file for a specific string and then look for other instances after that? I want to search for all Virtual Hosts and print out the Server Name and Document Root (if it has that info), while discarding the rest of the info. Basically my file looks like this: ...... (6 Replies)
Discussion started by: Mbohmer
6 Replies

10. Shell Programming and Scripting

Awk command for search a string in lspv

I 've got this retourn when i tape the commande lspv: hdisk0 00c3fce454950416 rootvg active hdisk1 00c3fce454950416 rootvg active I want to verify if hdisk0 et hdisk1 have the same pvid (ex : 00c3fce454950416)? Can... (8 Replies)
Discussion started by: khalidou13
8 Replies
Login or Register to Ask a Question