<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Scripting help needed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937437#M288380</link>
    <description>&amp;gt;&amp;gt; Any Suggestion welcome. &lt;BR /&gt;&lt;BR /&gt;Ok: &lt;BR /&gt;1- If you are not comfortable scripting, or adapting the suggested solutions, then just take the closest solution and go into an editor and do the thing alright! You could have been done by now.&lt;BR /&gt;But scripting is preferable, even if it is more work, because it will get it right, and it will be repeatable.&lt;BR /&gt;&lt;BR /&gt;2- If you want us to help better, then PLEASE be more explicit on what you want. &lt;BR /&gt;Input: blah.xxx.blahblah&lt;BR /&gt;Output: command blah.xxx yyy xxx ?&lt;BR /&gt;Conditions?&lt;BR /&gt;&lt;BR /&gt;3-Google!  +bcv +vg +import&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=349968" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=349968&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;4- MAN PAGE: vgchid&lt;BR /&gt;&lt;BR /&gt;5 - Uniq only compares ADJACENT lines. So you must pre-sort the file or know for sure it is (still) sorted after the transformations.&lt;BR /&gt;&lt;BR /&gt;6- Try this &lt;BR /&gt;&lt;BR /&gt;ls | -ne s/(bcv\d+)\..*$/$1/; print unless $seen{$_}++"&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Sat, 03 Feb 2007 10:11:54 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-02-03T10:11:54Z</dc:date>
    <item>
      <title>Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937427#M288370</link>
      <description>Hi, &lt;BR /&gt;In a directory i have the following files. Is there any way which will give me only the vg names out of this. I want to write a script in which i need to put the command so that and export the VGs from the server.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;vg_p01_ss01.bcv1.imp.ksh&lt;BR /&gt;vg_p01_ss01.imp.ksh&lt;BR /&gt;vg_p01_ss02.bcv1.imp.ksh&lt;BR /&gt;vg_p01_ss02.imp.ksh&lt;BR /&gt;vg_p01_ss03.bcv1.imp.ksh&lt;BR /&gt;vg_p01_ss03.imp.ksh&lt;BR /&gt;vg_p01_ss04.bcv1.imp.ksh&lt;BR /&gt;vg_p01_ss04.imp.ksh&lt;BR /&gt;vg_p01_ss05.bcv1.imp.ksh&lt;BR /&gt;vg_p01_ss05.imp.ksh&lt;BR /&gt;vg_p01_ss06.bcv1.imp.ksh&lt;BR /&gt;vg_p01_ss06.imp.ksh&lt;BR /&gt;vg_p02_ss01.bcv1.imp.ksh&lt;BR /&gt;vg_p02_ss01.imp.ksh&lt;BR /&gt;vg_p02_ss02.bcv1.imp.ksh&lt;BR /&gt;vg_p02_ss02.imp.ksh&lt;BR /&gt;vg_p02_ss03.bcv1.imp.ksh&lt;BR /&gt;vg_p02_ss03.imp.ksh&lt;BR /&gt;vg_p02_ss04.bcv1.imp.ksh&lt;BR /&gt;vg_p02_ss04.imp.ksh&lt;BR /&gt;vg_p02_ss05.bcv1.imp.ksh&lt;BR /&gt;vg_p02_ss05.imp.ksh&lt;BR /&gt;vg_p03_ss01.bcv1.imp.ksh&lt;BR /&gt;vg_p03_ss01.imp.ksh&lt;BR /&gt;vg_p03_ss02.bcv1.imp.ksh&lt;BR /&gt;vg_p03_ss02.imp.ksh&lt;BR /&gt;vg_p03_ss03.bcv1.imp.ksh&lt;BR /&gt;vg_p03_ss03.imp.ksh&lt;BR /&gt;vg_p03_ss04.bcv1.imp.ksh&lt;BR /&gt;vg_p03_ss04.imp.ksh&lt;BR /&gt;vg_p03_ss05.bcv1.imp.ksh&lt;BR /&gt;vg_p03_ss05.imp.ksh&lt;BR /&gt;vg_p04_ss01.bcv1.imp.ksh&lt;BR /&gt;vg_p04_ss01.imp.ksh&lt;BR /&gt;vg_p04_ss02.bcv1.imp.ksh&lt;BR /&gt;vg_p04_ss02.imp.ksh&lt;BR /&gt;vg_p04_ss03.bcv1.imp.ksh&lt;BR /&gt;vg_p04_ss04.bcv1.imp.ksh&lt;BR /&gt;vg_p04_ss05.bcv1.imp.ksh&lt;BR /&gt;vg_p05_ss01.bcv1.imp.ksh&lt;BR /&gt;vg_p05_ss01.imp.ksh&lt;BR /&gt;vg_p05_ss02.bcv1.imp.ksh&lt;BR /&gt;vg_p05_ss03.bcv1.imp.ksh&lt;BR /&gt;vg_p06_ss01.bcv1.imp.ksh&lt;BR /&gt;vgp_sam_a2.imp.ksh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any Suggestion welcome.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Feb 2007 13:37:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937427#M288370</guid>
      <dc:creator>Amit Manna_6</dc:creator>
      <dc:date>2007-02-02T13:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937428#M288371</link>
      <description>Hi Amit:&lt;BR /&gt;&lt;BR /&gt;I am going to assume that the volume group name ends at the dot character.  Hence, I assume that a valid name is "vg_p01_ss01" for example.  Then:&lt;BR /&gt;&lt;BR /&gt;# perl -nle 'print $1 if /(vg.*?)\./' file | uniq&lt;BR /&gt;&lt;BR /&gt;...will produce a list of unique names.&lt;BR /&gt;&lt;BR /&gt;You can also do:&lt;BR /&gt;&lt;BR /&gt;# ls | perl -nle 'print $1 if /(vg.*?)\./' | uniq&lt;BR /&gt;&lt;BR /&gt;...to pass your list of files from a directory list output directly.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 02 Feb 2007 13:48:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937428#M288371</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-02-02T13:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937429#M288372</link>
      <description>Something like:&lt;BR /&gt;&lt;BR /&gt;for file in $(ls); &lt;BR /&gt;do echo ${file%%.*};done | sort -u&lt;BR /&gt;&lt;BR /&gt;Is that what you're looking for? If you want the duplicates remove the | sort -u.</description>
      <pubDate>Fri, 02 Feb 2007 13:49:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937429#M288372</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2007-02-02T13:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937430#M288373</link>
      <description># awk -F. '{print $1 | "uniq"}' inp | xargs -n1 vgexport</description>
      <pubDate>Fri, 02 Feb 2007 14:22:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937430#M288373</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-02-02T14:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937431#M288374</link>
      <description>&lt;BR /&gt;Amit, &lt;BR /&gt;Here is a perl one-liner to get the names:&lt;BR /&gt;&lt;BR /&gt;perl -ne s/\..*$//; print unless $seen{$_}++ tmp.txt&lt;BR /&gt;&lt;BR /&gt;-n : loop throug input, Not printing each $_&lt;BR /&gt;-e : program text follows&lt;BR /&gt;&lt;BR /&gt;s/\..*$//;  : Find text from first dot to end and Substitue with nothing.&lt;BR /&gt;&lt;BR /&gt;$seen{$_}++ : auto increment associative array element with key "$_" = vg name.&lt;BR /&gt;The first increment the value is still false&lt;BR /&gt;Any further increment it true = none zero&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I think this, as well as the other suggestions solve the immediate question.&lt;BR /&gt;&lt;BR /&gt;However, you should consider NOT using the intermediate file. As any of those suggestions generate a uniq name, just construct the full command and make them do the real tasks right there.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein</description>
      <pubDate>Fri, 02 Feb 2007 19:50:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937431#M288374</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-02-02T19:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937432#M288375</link>
      <description>All,&lt;BR /&gt;Thanks for all thes inputs. I will check these Monday and accordingly assign points -:)</description>
      <pubDate>Fri, 02 Feb 2007 21:52:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937432#M288375</guid>
      <dc:creator>Amit Manna_6</dc:creator>
      <dc:date>2007-02-02T21:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937433#M288376</link>
      <description>Hi&lt;BR /&gt;Go to directory where you have the files and execute the following coomand to fulfill your requirements, you can can any optional arguements to the vgexport&lt;BR /&gt;ls -ltr | awk '{print $9}'|cut -d . -f 1 | uniq |xargs vgexport&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Happy Scripting&lt;BR /&gt;&lt;BR /&gt;TQ&lt;BR /&gt;Perumal&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Feb 2007 23:44:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937433#M288376</guid>
      <dc:creator>perumal_2</dc:creator>
      <dc:date>2007-02-02T23:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937434#M288377</link>
      <description>HI, &lt;BR /&gt;I tried ls -ltr | awk '{print $9}'|cut -d . -f 1 | uniq |&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am getting this &lt;BR /&gt;&lt;BR /&gt;vg_p01_ss05&lt;BR /&gt;vg_p02_ss01&lt;BR /&gt;vg_p02_ss02&lt;BR /&gt;vg_p02_ss03&lt;BR /&gt;vg_p02_ss04&lt;BR /&gt;vg_p02_ss05&lt;BR /&gt;vg_p03_ss01&lt;BR /&gt;vg_p03_ss02&lt;BR /&gt;vg_p03_ss03&lt;BR /&gt;vg_p03_ss04&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p01_ss05&lt;BR /&gt;vg_p01_ss01&lt;BR /&gt;vg_p01_ss02&lt;BR /&gt;vg_p01_ss03&lt;BR /&gt;vg_p01_ss04&lt;BR /&gt;vg_p04_ss01&lt;BR /&gt;vg_p05_ss01&lt;BR /&gt;vg_p04_ss02&lt;BR /&gt;vgp_sam_a2&lt;BR /&gt;vg_p03_ss03&lt;BR /&gt;vg_p03_ss04&lt;BR /&gt;vg_p01_ss06&lt;BR /&gt;xpinfo&lt;BR /&gt;vg_p04_ss03&lt;BR /&gt;vg_p05_ss03&lt;BR /&gt;vg_p04_ss05&lt;BR /&gt;vg_p04_ss04&lt;BR /&gt;vg_p03_ss04&lt;BR /&gt;vg_p05_ss02&lt;BR /&gt;vg_p03_ss03&lt;BR /&gt;vg_p04_ss02&lt;BR /&gt;vg_p05_ss01&lt;BR /&gt;vg_p03_ss03&lt;BR /&gt;vg_p03_ss04&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p05_ss01&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p03_ss04&lt;BR /&gt;vg_p05_ss01&lt;BR /&gt;vg_p04_ss03&lt;BR /&gt;vg_p04_ss04&lt;BR /&gt;vg_p05_ss03&lt;BR /&gt;vg_p03_ss04&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p04_ss02&lt;BR /&gt;mapfile&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p05_ss02&lt;BR /&gt;vg_p04_ss05&lt;BR /&gt;vg_p05_ss03&lt;BR /&gt;vg_p04_ss03&lt;BR /&gt;vg_p03_ss03&lt;BR /&gt;vg_p04_ss04&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p01_ss05&lt;BR /&gt;vg_p02_ss01&lt;BR /&gt;vg_p02_ss04&lt;BR /&gt;vg_p02_ss02&lt;BR /&gt;vg_p03_ss01&lt;BR /&gt;vg_p03_ss02&lt;BR /&gt;vg_p02_ss03&lt;BR /&gt;vg_p02_ss05&lt;BR /&gt;vg_p05_ss01&lt;BR /&gt;vg_p06_ss01&lt;BR /&gt;vg_p01_ss01&lt;BR /&gt;vg_p01_ss02&lt;BR /&gt;vg_p01_ss03&lt;BR /&gt;vg_p01_ss04&lt;BR /&gt;vg_p04_ss01&lt;BR /&gt;vg_p01_ss06&lt;BR /&gt;vg_p06_ss01&lt;BR /&gt;vg_p05_ss02&lt;BR /&gt;vg_p04_ss04&lt;BR /&gt;vg_p04_ss05&lt;BR /&gt;vg_p04_ss03&lt;BR /&gt;vg_p05_ss02&lt;BR /&gt;vg_p05_ss03&lt;BR /&gt;vg_p04_ss05&lt;BR /&gt;vg_p05_ss03&lt;BR /&gt;vg_p04_ss03&lt;BR /&gt;vg_p02_ss01&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p02_ss04&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p01_ss04&lt;BR /&gt;vg_p03_ss05&lt;BR /&gt;vg_p03_ss03&lt;BR /&gt;vg_p01_ss05&lt;BR /&gt;vg_p01_ss04&lt;BR /&gt;vg_p01_ss05&lt;BR /&gt;vg_p02_ss04&lt;BR /&gt;vg_p03_ss04&lt;BR /&gt;vg_p02_ss04&lt;BR /&gt;vg_p03_ss04&lt;BR /&gt;vg_p01_ss03&lt;BR /&gt;vg_p01_ss02&lt;BR /&gt;vg_p01_ss03&lt;BR /&gt;vg_p03_ss01&lt;BR /&gt;vg_p02_ss05&lt;BR /&gt;vg_p02_ss02&lt;BR /&gt;vg_p01_ss01&lt;BR /&gt;vg_p01_ss02&lt;BR /&gt;vg_p02_ss03&lt;BR /&gt;vg_p02_ss02&lt;BR /&gt;vg_p03_ss01&lt;BR /&gt;vg_p02_ss05&lt;BR /&gt;vg_p01_ss01&lt;BR /&gt;vg_p04_ss01&lt;BR /&gt;vg_p01_ss06&lt;BR /&gt;vg_p05_ss01&lt;BR /&gt;vg_p03_ss02&lt;BR /&gt;vg_p05_ss01&lt;BR /&gt;vg_p04_ss02&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also i tried this for file in $(ls);&lt;BR /&gt;&amp;gt; do echo ${file%%.*};done | sort -u&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am getting same result. The bcv part from the VG is missing. What is the way to get that/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please help me out. I have to do it today.</description>
      <pubDate>Sat, 03 Feb 2007 08:03:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937434#M288377</guid>
      <dc:creator>Amit Manna_6</dc:creator>
      <dc:date>2007-02-03T08:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937435#M288378</link>
      <description># cut -d . -f 1 file_nm | uniq | xargs -n 1 command&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 03 Feb 2007 08:24:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937435#M288378</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2007-02-03T08:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937436#M288379</link>
      <description># cut -d . -f 1 file_nm | uniq | xargs -n 1 vgexport           #Enjoy.</description>
      <pubDate>Sat, 03 Feb 2007 08:26:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937436#M288379</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2007-02-03T08:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937437#M288380</link>
      <description>&amp;gt;&amp;gt; Any Suggestion welcome. &lt;BR /&gt;&lt;BR /&gt;Ok: &lt;BR /&gt;1- If you are not comfortable scripting, or adapting the suggested solutions, then just take the closest solution and go into an editor and do the thing alright! You could have been done by now.&lt;BR /&gt;But scripting is preferable, even if it is more work, because it will get it right, and it will be repeatable.&lt;BR /&gt;&lt;BR /&gt;2- If you want us to help better, then PLEASE be more explicit on what you want. &lt;BR /&gt;Input: blah.xxx.blahblah&lt;BR /&gt;Output: command blah.xxx yyy xxx ?&lt;BR /&gt;Conditions?&lt;BR /&gt;&lt;BR /&gt;3-Google!  +bcv +vg +import&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=349968" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=349968&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;4- MAN PAGE: vgchid&lt;BR /&gt;&lt;BR /&gt;5 - Uniq only compares ADJACENT lines. So you must pre-sort the file or know for sure it is (still) sorted after the transformations.&lt;BR /&gt;&lt;BR /&gt;6- Try this &lt;BR /&gt;&lt;BR /&gt;ls | -ne s/(bcv\d+)\..*$/$1/; print unless $seen{$_}++"&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Sat, 03 Feb 2007 10:11:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937437#M288380</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-02-03T10:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937438#M288381</link>
      <description>Oh, forgot to ask... does that setup really have dozens of volume groups? Each perhaps based on a single Physical Volume?&lt;BR /&gt;&lt;BR /&gt;Please review the notion of Volume GROUPS.&lt;BR /&gt;&lt;BR /&gt;The system perform better, and be easier to manage if it is set up with multiple PV's in fewer VG's carved out to multiple LV's each.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein van den Heuvel&lt;BR /&gt;HvdH Peformance Consulting&lt;BR /&gt;</description>
      <pubDate>Sat, 03 Feb 2007 10:15:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937438#M288381</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-02-03T10:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937439#M288382</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;It would have be easier, had you defined what constituted a volume group name in the beginning.  That said, your data suggests that this will work:&lt;BR /&gt;&lt;BR /&gt;# perl -nle 'print $1 if /(vg.+\.bcv\d)\..*/' file&lt;BR /&gt;&lt;BR /&gt;(or):&lt;BR /&gt;&lt;BR /&gt;# ls /path | perl -nle 'print $1 if /(vg.+\.bcv\d)\..*/'&lt;BR /&gt;&lt;BR /&gt;Now, if you want to perform this extraction and 'vgexport' the volume groups, you could do:&lt;BR /&gt;&lt;BR /&gt;# ls path | perl -nle 'print $1 if /(vg.+\.bcv\d)\..*/' | xargs -n 1 -i vgchange -a n {}&lt;BR /&gt;&lt;BR /&gt;This inactivates the volume groups before their export.  Then, follow with:&lt;BR /&gt;&lt;BR /&gt;# ls path | perl -nle 'print $1 if /(vg.+\.bcv\d)\..*/' | xargs -n 1 -i vgexport -v -s -m {}.mapfile {}  &lt;BR /&gt;&lt;BR /&gt;This performs the actual 'vgexport' *and* keeps a mapfile of the volume group for reuse.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 03 Feb 2007 10:20:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-needed/m-p/3937439#M288382</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-02-03T10:20:20Z</dc:date>
    </item>
  </channel>
</rss>

