<?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: Help required on setting date variable in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517981#M681389</link>
    <description>Thanks Dennis.&lt;BR /&gt;&lt;BR /&gt;I have created a script named test.sh. Could you please let me know if this is correct?&lt;BR /&gt;&lt;BR /&gt;more test.sh&lt;BR /&gt;# get month abbreviations in abmon&lt;BR /&gt;eval $(locale -k abmon | sed 's/";"//g')&lt;BR /&gt;x=$(&lt;BR /&gt;awk -v abmon=$abmon -F, '&lt;BR /&gt;NR == 2 {&lt;BR /&gt;   # print $2&lt;BR /&gt;   year=substr($2,1,2) + 2000&lt;BR /&gt;   mon=substr($2,3,2)&lt;BR /&gt;   day=substr($2,5,2)&lt;BR /&gt;   print day "-" substr(abmon, 3*(mon)-2, 3) "-" year&lt;BR /&gt;}'ETCTRN4010000A.092309.023021001.txt)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Gaby1110</description>
    <pubDate>Wed, 21 Oct 2009 09:37:22 GMT</pubDate>
    <dc:creator>Gaby1110</dc:creator>
    <dc:date>2009-10-21T09:37:22Z</dc:date>
    <item>
      <title>Help required on setting date variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517978#M681386</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Need your help.I need to get the date from the second line of a file&lt;BR /&gt;&lt;BR /&gt;[devuser@vfabuser ~]$ head -n2 ETCTRN4010000A.092309.023021001.txt | tail -n1&lt;BR /&gt;&lt;BR /&gt;02,3009483,121000248,1,090922,,,/ &lt;BR /&gt;[devuser@vfabuser ~]$&lt;BR /&gt;&lt;BR /&gt;If you see above, I need 090922 stored to a variable as ‘22-SEP-2009’&lt;BR /&gt;&lt;BR /&gt;Please help.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Gaby1110</description>
      <pubDate>Wed, 21 Oct 2009 06:28:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517978#M681386</guid>
      <dc:creator>Gaby1110</dc:creator>
      <dc:date>2009-10-21T06:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help required on setting date variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517979#M681387</link>
      <description>&lt;!--!*#--&gt;# get month abbreviations in abmon&lt;BR /&gt;eval $(locale -k abmon | sed 's/";"//g')&lt;BR /&gt;&lt;BR /&gt;awk -v abmon=$abmon -F, '&lt;BR /&gt;NR == 2 {&lt;BR /&gt;   # print $5&lt;BR /&gt;   year=substr($5,1,2) + 2000&lt;BR /&gt;   mon=substr($5,3,2)&lt;BR /&gt;   day=substr($5,5,2)&lt;BR /&gt;   print day "-" substr(abmon, 3*(mon)-2, 3) "-" year&lt;BR /&gt;}' ETCTRN4010000A.092309.023021001.txt</description>
      <pubDate>Wed, 21 Oct 2009 07:11:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517979#M681387</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-10-21T07:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help required on setting date variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517980#M681388</link>
      <description>To get it into a variable, wrap the whole thing in $()&lt;BR /&gt;x=$(&lt;BR /&gt;awk -v abmon=$abmon -F, '&lt;BR /&gt;...&lt;BR /&gt;}' ETCTRN4010000A.092309.023021001.txt)</description>
      <pubDate>Wed, 21 Oct 2009 07:14:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517980#M681388</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-10-21T07:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help required on setting date variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517981#M681389</link>
      <description>Thanks Dennis.&lt;BR /&gt;&lt;BR /&gt;I have created a script named test.sh. Could you please let me know if this is correct?&lt;BR /&gt;&lt;BR /&gt;more test.sh&lt;BR /&gt;# get month abbreviations in abmon&lt;BR /&gt;eval $(locale -k abmon | sed 's/";"//g')&lt;BR /&gt;x=$(&lt;BR /&gt;awk -v abmon=$abmon -F, '&lt;BR /&gt;NR == 2 {&lt;BR /&gt;   # print $2&lt;BR /&gt;   year=substr($2,1,2) + 2000&lt;BR /&gt;   mon=substr($2,3,2)&lt;BR /&gt;   day=substr($2,5,2)&lt;BR /&gt;   print day "-" substr(abmon, 3*(mon)-2, 3) "-" year&lt;BR /&gt;}'ETCTRN4010000A.092309.023021001.txt)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Gaby1110</description>
      <pubDate>Wed, 21 Oct 2009 09:37:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517981#M681389</guid>
      <dc:creator>Gaby1110</dc:creator>
      <dc:date>2009-10-21T09:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help required on setting date variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517982#M681390</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Could you please let me know if this is correct?&lt;BR /&gt;&lt;BR /&gt;Why don't you try running it?  "Correct" is whatever faithfully produces the desired output without false results in this case.  You can't hurt anything by trying!&lt;BR /&gt;&lt;BR /&gt;That said, the last line needs a space added.  Instead of:&lt;BR /&gt;&lt;BR /&gt;}'ETCTRN4010000A.092309.023021001.txt)&lt;BR /&gt;&lt;BR /&gt;You should have:&lt;BR /&gt;&lt;BR /&gt;}' ETCTRN4010000A.092309.023021001.txt)&lt;BR /&gt;&lt;BR /&gt;That is, there is one or more whitespaces avter the closing tick for the 'awk' script, before the name of the file you want to process.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Oct 2009 11:08:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517982#M681390</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-10-21T11:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help required on setting date variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517983#M681391</link>
      <description>Thanks all for your help . Will assign the points..&lt;BR /&gt;Gaby</description>
      <pubDate>Wed, 21 Oct 2009 12:24:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517983#M681391</guid>
      <dc:creator>Gaby1110</dc:creator>
      <dc:date>2009-10-21T12:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help required on setting date variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517984#M681392</link>
      <description>&amp;gt;I have created a script named test.sh. Could you please let me know if this is correct?&lt;BR /&gt;&lt;BR /&gt;I would include this at the top of your script:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;(Or sh.)&lt;BR /&gt;&lt;BR /&gt;You initially had field 5 and now you have 2.&lt;BR /&gt;&lt;BR /&gt;Note that once you get it into a variable, you would have to use that variable in your script.&lt;BR /&gt;Or you could make this script echo the value and then you can use this script inside other scripts.&lt;BR /&gt;&lt;BR /&gt;So how do you intend to use that script?  I assumed you would take my script fragment and insert it into another script.</description>
      <pubDate>Wed, 21 Oct 2009 23:39:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-required-on-setting-date-variable/m-p/4517984#M681392</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-10-21T23:39:54Z</dc:date>
    </item>
  </channel>
</rss>

