Sponsored Content
Top Forums Shell Programming and Scripting Sed/awk : to grep only required pattern disk Post 302846061 by Jotne on Friday 23rd of August 2013 01:18:50 AM
Old 08-23-2013
Code:
awk '/Physical volume groups/ {f=1} !f && /PV Name/ {print $NF}'
/dev/disk/disk4704
/dev/disk/disk4705

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep required pattern and next 2 or 3 lines

dear ones pl.kindly help me 1) how to print(grep) required pattern and following 2 or 3 lines. 2) grep required pattern(to print)+above 2 lines+below 2 or 3 lines.from a report file. ex: we have some report file kf askfjsk fksaj fk skf sjfksjd kff sjfkjs kf jskdjfklsd jfklsdf sdkfjsd fsd... (3 Replies)
Discussion started by: cvvsnm
3 Replies

2. Shell Programming and Scripting

Split a file based on pattern in awk, grep, sed or perl

Hi All, Can someone please help me write a script for the following requirement in awk, grep, sed or perl. Buuuu xxx bbb Kmmmm rrr ssss uuuu Kwwww zzzz ccc Roooowwww eeee Bxxxx jjjj dddd Kuuuu eeeee nnnn Rpppp cccc vvvv cccc Rhhhhhhyyyy tttt Lhhhh rrrrrssssss Bffff mmmm iiiii Ktttt... (5 Replies)
Discussion started by: kumarn
5 Replies

3. Shell Programming and Scripting

Extracting pattern only with AWK | SED | GREP

We have the following statement working in CGYWIN, but when we move the program to Solaris 10 it fails. x=`echo "ABC196925XYZ" | grep -o --only-matching "\{6\}"` How can we use AWK or SED to extract only the number from the string? The following outputs the entire string. We only want... (5 Replies)
Discussion started by: James Clark
5 Replies

4. UNIX for Advanced & Expert Users

Urgent Help required : awk/sed help to find pattern and delete till end of line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (1 Reply)
Discussion started by: rajan_san
1 Replies

5. Shell Programming and Scripting

How to awk/sed/grep lines which contains a pattern at a given position

Dear friends I am new to linux and was trying to split some files userwise in our linux server. I have a data file of 156 continuous columns named ecscr final. I want the script to redirect all the lines containing a pattern of 7 digits to separate files. I was using grep to do that,... (2 Replies)
Discussion started by: anoopvraj
2 Replies

6. Shell Programming and Scripting

Goto each directory and subdirectories and grep the required pattern

Hi All, I need your help in finding pattern from files present in different directories. I need to search for a pattern "xyz" from "*.txt" files which are present in different levels of directories as shown. example ------- dir1/subdir1/file.txt dir2/subdir2/subsubdir2/file.txt... (5 Replies)
Discussion started by: imas
5 Replies

7. Shell Programming and Scripting

Help to search multiple pattern in file with grep/sed/awk

Hello All, I have a file which is having below type of data, Jul 19 2011 | 123456 Jul 19 2011 | 123456 Jul 20 2011 | 123456 Jul 20 2011 | 123456 Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
Discussion started by: gr8_usk
9 Replies

8. UNIX for Dummies Questions & Answers

One liner pattern search with awk/sed/grep

I have an array containing bunch of characters. I have to check this array for specific character and if "Not Found than" use a goto statement to go to USAGE set options = (A B C D E F) @ i = 0 while ($i <= ${#options}) if ($options != "F" || $options != "D") then goto USAGE endif @... (1 Reply)
Discussion started by: dixits
1 Replies

9. Shell Programming and Scripting

How to print the lines between the pattern using awk/grep/sed?

Hi, I need a help to search a pattern and print the multiple lines between them. Input file: Tue May 29 12:30:33 EDT 2012:threadWebContainer : 357:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelCancelReservation request: ... (4 Replies)
Discussion started by: aroragaurav.84
4 Replies

10. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies
vgrestore(1M)															     vgrestore(1M)

NAME
vgrestore - restore a VxVM disk group back to an LVM volume group SYNOPSIS
/etc/vx/bin/vgrestore vg_name DESCRIPTION
The vgrestore command restores a Logical Volume Manager (LVM) volume group that was previously converted to a VxVM disk group by the vxvm- convert utility. ARGUMENTS
vg_name Specifies the name of a volume group that was converted to a VxVM disk group by the vxvmconvert utility. EXIT CODES
vgrestore exits with one of the following values: 0 Successful completion. >0 Failure; an error occurred. WARNINGS
vgrestore functions only on VxVM disk groups that were converted from LVM volume groups by the vxvmconvert command. It is a good idea to back up user data before running vgrestore, and restore it after the vgrestore completes, as vgrestore can only restore a logical volume back to the state it was in before conversion to VxVM. If data changed on the volume while it was a VxVM volume, the changes won't be reflected on the volume after being restored to LVM. As part of the original conversion process, applications that once referenced the now-converted LVM volume's path names may have changed to reference VxVM volume special device file names. Alternatively, special device file path names originally representing the now-converted LVM volumes may have changed to symbolic links pointing to the VxVM volume path names. Be sure to undo these actions when restoring back to LVM. Do not use vgrestore unless you are certain that you want to restore LVM volume groups. After vgrestore this is run, the VxVM disks will no longer exist. EXAMPLES
To restore the LVM volume group vg03 that was converted by vxvmconvert to the VxVM disk group dg03, enter: vgcfgrestore vg03 SEE ALSO
vxvmconvert(1M) Veritas Volume Manager Migration Guide VxVM 5.0.31.1 24 Mar 2008 vgrestore(1M)
All times are GMT -4. The time now is 02:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy