<?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: Changing required field in file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503937#M705128</link>
    <description>The above one just chaning for one particular string, which has "log" in it, not other lines got changed..&lt;BR /&gt;Thanks &lt;BR /&gt;Praqshant</description>
    <pubDate>Mon, 14 Mar 2005 13:40:42 GMT</pubDate>
    <dc:creator>Prashant Zanwar_4</dc:creator>
    <dc:date>2005-03-14T13:40:42Z</dc:date>
    <item>
      <title>Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503924#M705115</link>
      <description>Hi, &lt;BR /&gt;I have some file which has all volumes of a particular field listed. &lt;BR /&gt;Fields are: &lt;BR /&gt;vg&lt;ENVNAME&gt;1&lt;BR /&gt;vg&lt;ENVNAME&gt;2&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;vg&lt;ENVNAME&gt;10&lt;BR /&gt;&lt;BR /&gt;I want to change all these by &lt;BR /&gt;vg&lt;ENVNAME&gt;1.SNAP&lt;BR /&gt;vg&lt;ENVNAME&gt;2.SNAP&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;vg&lt;ENVNAME&gt;10.SNAP&lt;BR /&gt;&lt;BR /&gt;Is it possible to do it one shot. I can do it using vi or sed 1 field at a time. &lt;BR /&gt;Thanks and regards&lt;BR /&gt;Prashant&lt;/ENVNAME&gt;&lt;/ENVNAME&gt;&lt;/ENVNAME&gt;&lt;/ENVNAME&gt;&lt;/ENVNAME&gt;&lt;/ENVNAME&gt;</description>
      <pubDate>Mon, 14 Mar 2005 08:48:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503924#M705115</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T08:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503925#M705116</link>
      <description>awk '/^vg/{print $0".SNAP"}' &amp;lt; inputfile &amp;gt; outputfile&lt;BR /&gt;&lt;BR /&gt;This assume that NO other lines start with lowercase vg.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Mar 2005 08:55:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503925#M705116</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2005-03-14T08:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503926#M705117</link>
      <description>OK sorry..I put it wrongly. &lt;BR /&gt;I have &lt;BR /&gt;&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;1/rv... /dev/vg&lt;ENV&gt;1/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;2/rv...   /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;10/rv.../dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;&lt;BR /&gt;Like this above. I didnt put rv completly, they are raw vols. I want to change ENVNAME[1-10] to &lt;BR /&gt;ENVNAME[1-10].SNAP (please note (ENV and env are different.) &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Prashant&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;</description>
      <pubDate>Mon, 14 Mar 2005 09:09:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503926#M705117</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T09:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503927#M705118</link>
      <description>Prashant,&lt;BR /&gt;&lt;BR /&gt;Lets say your filename is /tmp/test. You can use one command to replace this.&lt;BR /&gt;&lt;BR /&gt;sed 's/ENVNAME\&amp;gt;[1-9]/&amp;amp;.SNAP/' /tmp/test&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Mar 2005 09:48:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503927#M705118</guid>
      <dc:creator>Rajeev Tyagi</dc:creator>
      <dc:date>2005-03-14T09:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503928#M705119</link>
      <description>Prashant,&lt;BR /&gt;&lt;BR /&gt;One correction you may have issue with vg&lt;ENVNAME&gt;10. You can use &lt;BR /&gt;&lt;BR /&gt;sed 's/ENVNAME\&amp;gt;[1-9][0]/&amp;amp;.SNAP/' /tmp/test | sed 's/ENVNAME\&amp;gt;[1-9]/&amp;amp;.SNAP/' | sed 's/\.SNAP0/0/'&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;/ENVNAME&gt;</description>
      <pubDate>Mon, 14 Mar 2005 09:59:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503928#M705119</guid>
      <dc:creator>Rajeev Tyagi</dc:creator>
      <dc:date>2005-03-14T09:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503929#M705120</link>
      <description>thats not working rajeev..&lt;BR /&gt;Thanks&lt;BR /&gt;Prashant</description>
      <pubDate>Mon, 14 Mar 2005 10:41:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503929#M705120</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T10:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503930#M705121</link>
      <description>Prashant,&lt;BR /&gt;&lt;BR /&gt;I used your format in /tmp/test file&lt;BR /&gt;&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;1/rv... /dev/vg&lt;ENV&gt;1/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;2/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;3/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;4/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;5/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;6/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;7/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;8/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;9/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;10/rv.../dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;&lt;BR /&gt;And I get following output with&lt;BR /&gt;&lt;BR /&gt;#sed 's/ENVNAME\&amp;gt;[1-9][0]/&amp;amp;.SNAP/' /tmp/test | sed 's/ENVNAME\&amp;gt;[1-9]/&amp;amp;.SNAP/' | sed 's/\.SNAP0/0/'&lt;BR /&gt;&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;1.SNAP/rv... /dev/vg&lt;ENV&gt;1/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;2.SNAP/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;3.SNAP/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;4.SNAP/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;5.SNAP/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;6.SNAP/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;7.SNAP/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;8.SNAP/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;9.SNAP/rv... /dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;/dev/vg&lt;ENVNAME&gt;10.SNAP/rv.../dev/vg&lt;ENV&gt;2/rv...&lt;BR /&gt;&lt;BR /&gt;Please let me know if this is not your expected output, or if you are having syntax error with above command?&lt;BR /&gt;&lt;BR /&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;&lt;/ENV&gt;&lt;/ENVNAME&gt;</description>
      <pubDate>Mon, 14 Mar 2005 11:16:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503930#M705121</guid>
      <dc:creator>Rajeev Tyagi</dc:creator>
      <dc:date>2005-03-14T11:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503931#M705122</link>
      <description>I am attaching file here. I have done 10,11,12,13 manually. Still it will be helpful for me if there is a direct way. I dont have errors, it is generating same output as input. &lt;BR /&gt;Thanks and regards&lt;BR /&gt;Prashant</description>
      <pubDate>Mon, 14 Mar 2005 12:07:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503931#M705122</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T12:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503932#M705123</link>
      <description>A one line perl call-&lt;BR /&gt; &lt;BR /&gt;perl -pie 's{(/vg......\d+)/}{$1.SNAP/}' yourfile&lt;BR /&gt; &lt;BR /&gt;This will apply the change directly to "yourfile" so you may want a backup of it before trying this routine. Since your ENVNAME may have digits, I'm assuming that they are 6 characters long.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Mon, 14 Mar 2005 12:38:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503932#M705123</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-03-14T12:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503933#M705124</link>
      <description>The perl command throws error &lt;BR /&gt;( not expected and also if I remove that 1 not set..&lt;BR /&gt;&lt;BR /&gt;Thx&lt;BR /&gt;Prashant</description>
      <pubDate>Mon, 14 Mar 2005 13:14:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503933#M705124</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T13:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503934#M705125</link>
      <description>Looks like I need to seperate the options-&lt;BR /&gt;&lt;BR /&gt;perl -p -i -e 's{(/vg......\d+)/}{$1.SNAP/}' yourfile&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Mar 2005 13:25:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503934#M705125</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-03-14T13:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503935#M705126</link>
      <description>perl -p -i -e s{(/vgCTSPR\D+)/}{$1.SNAP/} EC3TCD_final.map_file.orig&lt;BR /&gt;sh: Syntax error: `(' is not expected.&lt;BR /&gt;&lt;BR /&gt;Thanks and regards&lt;BR /&gt;Prashant</description>
      <pubDate>Mon, 14 Mar 2005 13:29:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503935#M705126</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T13:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503936#M705127</link>
      <description>You may want to copy the script from here, rather then typing. There are curly braces which kind of look like parenthesis.&lt;BR /&gt;&lt;BR /&gt;perl -p -i -e 's{(/vg......\d+)/}{$1.SNAP/}' yourfile&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Mar 2005 13:33:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503936#M705127</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-03-14T13:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503937#M705128</link>
      <description>The above one just chaning for one particular string, which has "log" in it, not other lines got changed..&lt;BR /&gt;Thanks &lt;BR /&gt;Praqshant</description>
      <pubDate>Mon, 14 Mar 2005 13:40:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503937#M705128</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T13:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503938#M705129</link>
      <description>That's odd, I ran it against your file and got-&lt;BR /&gt; &lt;BR /&gt;/dev/vgCTSPRD-log/rv500-logb2-10 /dev/vgEC3TCD3.SNAP/rv500-logb2-10 510976&lt;BR /&gt;/dev/vgCTSPRD1.SNAP/rv20-cntrlb-1 /dev/vgEC3TCD1/rv20-cntrlb-1&lt;BR /&gt;/dev/vgCTSPRD2.SNAP/rv20-cntrlb-2 /dev/vgEC3TCD2/rv20-cntrlb-2&lt;BR /&gt;/dev/vgCTSPRD3.SNAP/rv1000-17 /dev/vgEC3TCD3/rv1000-17 1024000&lt;BR /&gt;/dev/vgCTSPRD4.SNAP/rv1000-25 /dev/vgEC3TCD4/rv1000-25 1024000&lt;BR /&gt;/dev/vgCTSPRD5.SNAP/rv2000-0362 /dev/vgEC3TCD5/rv2000-0362 2048000&lt;BR /&gt; &lt;BR /&gt;Which is what I thought what you were looking for.&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 14 Mar 2005 13:46:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503938#M705129</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-03-14T13:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503939#M705130</link>
      <description>If you don't want lines with "log" changed, then do the following-&lt;BR /&gt; &lt;BR /&gt;perl -p -i -e 's{(^/dev/vg......\d+)/}{$1.SNAP/}' yourfile</description>
      <pubDate>Mon, 14 Mar 2005 13:48:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503939#M705130</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-03-14T13:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503940#M705131</link>
      <description>Yeah I wanted the output like above. Thanks a lot for your help. Is it then difference in perl version or so? Not sure, but only changes lines with "log", i want o/p exactly like above. &lt;BR /&gt;Thanks&lt;BR /&gt;Prashant</description>
      <pubDate>Mon, 14 Mar 2005 14:01:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503940#M705131</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T14:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Changing required field in file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503941#M705132</link>
      <description>Sorry for that, perl statement did the trick this time. I was surely doing something wrong here I guess. I will change lines with -log using vi, not a issue. &lt;BR /&gt;Also I got it working using awk..so one more thing..&lt;BR /&gt;grep -i ^/ EC3TCD_final.map_file.orig | awk -F/ '{ print "/dev/"  $3 ".SNAP/" $4  " " "/dev/" $6 "/" $7 }'&lt;BR /&gt;&lt;BR /&gt;Thanks all for excellant help. &lt;BR /&gt;Best regards&lt;BR /&gt;Prashant</description>
      <pubDate>Mon, 14 Mar 2005 14:06:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-required-field-in-file/m-p/3503941#M705132</guid>
      <dc:creator>Prashant Zanwar_4</dc:creator>
      <dc:date>2005-03-14T14:06:04Z</dc:date>
    </item>
  </channel>
</rss>

