Sponsored Content
Top Forums Shell Programming and Scripting extracting desired value from cmd o/p Post 302343926 by ranjithpr on Friday 14th of August 2009 06:29:36 AM
Old 08-14-2009
In sed we can give sub patterns like \(pattern\) and I have sub divided your data 'Maximum volume size: 90406912 (44144Mb)' into three sub patterns

1. Maximum volume size: 90406912 ( - \(.*(\)
this will represent data the from beginning of the data to '('
2. 44144 - \([0-9]*\)
this will represent coninuous occurance of digits after '('
3. Mb) - \(Mb.*\)
this will represent the data from Mb to end of line

and I have used \2 to print only the second pattern.

sed 's/\(.*(\)\([0-9].*\)\(Mb.*\)/\2/'

Regards,

Ranjith
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

man <cmd> >> cmd.txt

I've noticed most of my postings here are because of syntax errors. So I want to begin compiling a large txt file that contains all the "man <cmd>" of the commands I most have problems with. I ran a "man nawk >> nawk.txt" but it included a header/footer on each "page". Anyone know how I'd be... (6 Replies)
Discussion started by: yongho
6 Replies

2. Shell Programming and Scripting

Script not working as desired

Reborg, Sorry to bother you. I have tried the code you suggested and it's not creating new files after they satisfy the criteria. If any of the files don't satisfy the criteria it should not create the files at all. Please see my output below. (39 Replies)
Discussion started by: mhssatya
39 Replies

3. Shell Programming and Scripting

Help me in getting the desired output

I wanted to put "|" this sign at starting and at end of every field but its not working with first field like Currently the out put is : abc | abc | abc | xyz | xyz | xyz | But I want the out put in this form: | abc | abc | abc | | xyz | xyz | xyz | plz help me. (2 Replies)
Discussion started by: akash
2 Replies

4. HP-UX

Desired Format !

Hi everybody, I just need desired ouput from text file which should have folowing format; "2007-06-25 00:03:32.926+05:30",12354369,"Load","Completed","Rs.-5,556.00",9452217714 "2007-06-25 00:06:57.357+05:30",12354371,"Load","Completed","Rs.-56.00",9415766266 "2007-06-25... (1 Reply)
Discussion started by: prasanth_babu
1 Replies

5. Shell Programming and Scripting

Unix cmd prompt how to get old cmd run?

Hi, I am using SunOS I want to serch my previous command from unix prompt (like on AIX we can search by ESC -k) how to get in SunOs urgent help require. (10 Replies)
Discussion started by: RahulJoshi
10 Replies

6. Shell Programming and Scripting

Extracting duplicates from a desired field

Hello, I have a file of group names and GID's (/etc/group) and I want to find the duplicate group names and put them in a file. So there are 2 fields, i.e.: audit 10 avahi 70 avahi-autoipd 103 bellrpi 605 bin 1 bin 2 bord 512 busobj 161 bwadm 230 cali81 202 card 323 cardiff 901 cbm... (2 Replies)
Discussion started by: mgb
2 Replies

7. Shell Programming and Scripting

need to get the desired output

Below is the my cide which is working fine but I am not getting the output indesired format.there is some problem in alignment.Can someone help me to correct this? if ]; then summary=$( echo -e "Please review the log file of auto coloclean utility.\n"; echo -e... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies

8. Shell Programming and Scripting

Perl open(CMD, "cmd |"); buffering problem..

Hello, There's a third-party application's command that shows the application's status like "tail -f verybusy.log". When use the command, the output comes every 1-sec. but when it goes in a script below the output comes every 8-sec...What is the problem and how can I fix it? open(CMD,... (2 Replies)
Discussion started by: Shawn, Lee
2 Replies

9. UNIX for Dummies Questions & Answers

Help me in getting the desired result

Hi All, I have input file which is pipe delimited A | 1 B | 2 c | 3I need output of displaying total number of lines in a file as last column. A | 1 | 3-----total number of linesin file. B | 2 | 3 c | 3 | 3 (9 Replies)
Discussion started by: pravinashwin
9 Replies

10. Shell Programming and Scripting

Desired Date format

I need to get the current year for the files that has been created today. Ex- when i list in unix console it shows ls -l abc.txt -rw-rw-r-- 1 user1 user1 33 May 2 08:58 abc.txt but i need to get as May 2 2013 , i dont need 08:58 is there any command to list it out in that... (7 Replies)
Discussion started by: Prashanth B
7 Replies
vxdco(1M)																 vxdco(1M)

NAME
vxdco - perform operations on DCO objects and DCO volumes SYNOPSIS
vxdco [-g diskgroup] att volume dco vxdco [-g diskgroup] attlogvol dco dco_volume vxdco [-g diskgroup] [-o rm] dis dco vxdco [-g diskgroup] [-o rm] dislogvol dco vxdco [-g diskgroup] -o force enable dco DESCRIPTION
Note: The vxdco command can only be used with version 0 DCOs and DCO volumes. It cannot be used with version 20 DCOs and DCO volumes. The vxdco command is used to manipulate version 0 data change objects (DCO objects or DCOs) and DCO volumes that allow the use of Persis- tent FastResync with volumes. The att operation attaches a DCO object, dco, to a volume, volume. If the DCO object has an associated DCO volume, you can use the command vxvol set fmr=on volume to enable Persistent FastResync on the volume after the att operation has completed. The attlogvol operation associates a DCO volume, dco_volume, with a DCO object, dco. If the DCO object is already attached to a volume, you can use the command vxvol set fmr=on volume to enable Persistent FastResync on the volume after the attlogvol operation has completed. The dis operation dissociates a DCO object, dco, from a volume, and disables FastResync on that volume. If the -o rm option is specified, the DCO object, the DCO volume, its plexes and associated subdisks are removed in the same operation. The dislogvol operation dissociates a DCO volume from a DCO object, dco, and disables FastResync on the parent volume. If the -o rm option is specified, the DCO volume, its plexes and associated subdisks are removed in the same operation. If an error occurs while reading or writing a DCO volume, it is detached and the badlog flag is set on the DCO. (You can use one of the options -a, -F or -m to vxprint to check if the badlog flag is set on a DCO.) The -o force enable operation clears the badlog flag on the DCO. The following command sequence demonstrates how to recover the DCO volume that tracks the top-level volume vol1 in the disk group egdg: vxdco -g egdg -o force enable vol1_dco vxvol -g egdg stop vol1 vxvol -g egdg start vol1 Here vol1_dco is the DCO associated with vol1. Caution: Only use the -o force enable operation if you are certain that no writes have gone to the volume since the error occurred that caused its DCO volume to become detached. Otherwise, data corruption may result. The -g diskgroup option specifies the disk group to which the parent volume, DCO object, and DCO volume belong. You can use the make keyword to vxassist to create a volume with an attached DCO object and DCO volume. You can also use the addlog key- word to vxassist to create and add a DCO object and DCO volume to an existing volume. vxdco may then be used to dissociate a DCO object from its parent volume, and subsequently reattach it if the DCO object and DCO volume have not been removed. The vxdco command is also used by vxassist and vxplex to handle the DCO objects and DCO volumes that are associated with volumes. The vxmake command is used to create DCO objects, which can be specified using output from vxprint. Note: When using disk group move, split and join (see vxdg(1M)) to move volumes or snapshot volumes between disk groups, take care to ensure that the DCO volumes accompany their parent volumes. EXIT CODES
The vxdco utility exits with a non-zero status if the attempted operation fails. A non-zero exit code is not a complete indicator of the problems encountered, but rather denotes the first condition that prevented further execution of the utility. See vxintro(1M) for a list of standard exit codes. NOTES
When a volume is attached to a DCO as its log volume, its device nodes are deleted. If vxdco dislogvol is subsequently used to dissociate the log volume from the DCO, the device nodes are not recreated. SEE ALSO
vxassist(1M), vxdg(1M), vxintro(1M), vxmake(1M), vxplex(1M), vxprint(1M), vxvol(1M) VxVM 5.0.31.1 24 Mar 2008 vxdco(1M)
All times are GMT -4. The time now is 06:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy