<?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: date format with a file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942497#M798317</link>
    <description>It worked......Thank you.</description>
    <pubDate>Wed, 23 Nov 2005 05:43:00 GMT</pubDate>
    <dc:creator>Robert DJ</dc:creator>
    <dc:date>2005-11-23T05:43:00Z</dc:date>
    <item>
      <title>date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942487#M798307</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I wanted to add date format along with a file, can anyone help...&lt;BR /&gt;&lt;BR /&gt;for e.g&lt;BR /&gt;date +%Y%m%d which gives 20051123, this should be attached to a file to say like "test.20051123".......&lt;BR /&gt;&lt;BR /&gt;Thank you in advance.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robs</description>
      <pubDate>Wed, 23 Nov 2005 04:44:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942487#M798307</guid>
      <dc:creator>Robert DJ</dc:creator>
      <dc:date>2005-11-23T04:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942488#M798308</link>
      <description>Then do as,&lt;BR /&gt;&lt;BR /&gt;tocuch test.$(date +%Y%m%d)&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Wed, 23 Nov 2005 04:51:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942488#M798308</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-23T04:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942489#M798309</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Try this&lt;BR /&gt;&lt;BR /&gt;dateA=`date +%Y%m%d`&lt;BR /&gt;cat abc &amp;gt; test.$dateA</description>
      <pubDate>Wed, 23 Nov 2005 04:52:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942489#M798309</guid>
      <dc:creator>Luk Vandenbussche</dc:creator>
      <dc:date>2005-11-23T04:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942490#M798310</link>
      <description>typo as,&lt;BR /&gt;&lt;BR /&gt;touch test.$(date +%Y%m%d)&lt;BR /&gt;&lt;BR /&gt;or as,&lt;BR /&gt;&lt;BR /&gt;cat &amp;gt; test.`date +%Y%m%d`&lt;BR /&gt;hi&lt;BR /&gt;ctr+d&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;cp /dev/null test.`date +%Y%m%d`&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Wed, 23 Nov 2005 04:53:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942490#M798310</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-23T04:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942491#M798311</link>
      <description>Luk,&lt;BR /&gt;&lt;BR /&gt;A note for you.&lt;BR /&gt;&lt;BR /&gt;If we are using the code of,&lt;BR /&gt;&lt;BR /&gt;dateA=`date +%Y%m%d`&lt;BR /&gt;cat abc &amp;gt; test.$dateA&lt;BR /&gt;&lt;BR /&gt;with shell script then,&lt;BR /&gt;&lt;BR /&gt;dateA will be with 20051123.&lt;BR /&gt;&lt;BR /&gt;test.($2)0051123&lt;BR /&gt;&lt;BR /&gt;if we give argument with more than one then, second argument is substitued (say example ./script.ksh first luk third)&lt;BR /&gt;then,&lt;BR /&gt;&lt;BR /&gt;file will be like,&lt;BR /&gt;&lt;BR /&gt;test.luk0051123&lt;BR /&gt;&lt;BR /&gt;to over ride that,&lt;BR /&gt;&lt;BR /&gt;dateA=`date +%Y%m%d`&lt;BR /&gt;cat abc &amp;gt; test.${dateA}&lt;BR /&gt;&lt;BR /&gt;that is all.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Wed, 23 Nov 2005 04:57:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942491#M798311</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-23T04:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942492#M798312</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;The thing is it works if it is a simple file creation....&lt;BR /&gt;&lt;BR /&gt;I would like to append to the file with each output that arrives through my commands,&lt;BR /&gt;&lt;BR /&gt;for e.g,&lt;BR /&gt;the commands i try might bdf, swapinfo and so on....&lt;BR /&gt;&lt;BR /&gt;these outputs needs to be appended along with the file "test.20051123"&lt;BR /&gt;&lt;BR /&gt;The normal way of the using the date command doesnt seem to accept the redirections....&lt;BR /&gt;&lt;BR /&gt;i tried using the following,&lt;BR /&gt;&lt;BR /&gt;dateA='date +%Y%m%d'&lt;BR /&gt;touch log.$dateA&lt;BR /&gt;&lt;BR /&gt;bdf &amp;gt;&amp;gt; log.$dateA&lt;BR /&gt;&lt;BR /&gt;can u help........&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robs</description>
      <pubDate>Wed, 23 Nov 2005 05:12:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942492#M798312</guid>
      <dc:creator>Robert DJ</dc:creator>
      <dc:date>2005-11-23T05:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942493#M798313</link>
      <description>HI&lt;BR /&gt;&lt;BR /&gt;Have u used 'date +%Y%m%d'  or `date +%Y%m%d`&lt;BR /&gt;&lt;BR /&gt;There is difference in the quotes being used.&lt;BR /&gt;&lt;BR /&gt;IF you want the variable dateA to be available in that shell, do&lt;BR /&gt;&lt;BR /&gt;export dateA=`date +%Y%m%d`&lt;BR /&gt;touch log.$dateA&lt;BR /&gt;bdf&amp;gt;&amp;gt;log.$dateA&lt;BR /&gt;&lt;BR /&gt;It works for me...!!!!&lt;BR /&gt;&lt;BR /&gt;Regrds&lt;BR /&gt;CS</description>
      <pubDate>Wed, 23 Nov 2005 05:23:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942493#M798313</guid>
      <dc:creator>saju_2</dc:creator>
      <dc:date>2005-11-23T05:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942494#M798314</link>
      <description>See my above reply.&lt;BR /&gt;&lt;BR /&gt;Use like,&lt;BR /&gt;&lt;BR /&gt;FILE="log.$(date +%Y%m%d)"&lt;BR /&gt;bdf &amp;gt;&amp;gt; ${FILE}&lt;BR /&gt;swapinfo -tam &amp;gt;&amp;gt; ${FILE}&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;FILE="log.$(date +%Y%m%d)"&lt;BR /&gt;(&lt;BR /&gt;bdf&lt;BR /&gt;swapinfo -tam&lt;BR /&gt;hostname&lt;BR /&gt;ls&lt;BR /&gt;) &amp;gt; ${FILE}&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Wed, 23 Nov 2005 05:28:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942494#M798314</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-23T05:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942495#M798315</link>
      <description>Use another way as,&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;command1&lt;BR /&gt;command2&lt;BR /&gt;...&lt;BR /&gt;commandn&lt;BR /&gt;} &amp;gt; test.$(date +%Y%m%d)&lt;BR /&gt;&lt;BR /&gt;To get that result in console also then,&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;command1&lt;BR /&gt;command2&lt;BR /&gt;...&lt;BR /&gt;commandn&lt;BR /&gt;} | tee -a test.$(date +%Y%m%d)&lt;BR /&gt;&lt;BR /&gt;tee with -a will append results more.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Nov 2005 05:41:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942495#M798315</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-23T05:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942496#M798316</link>
      <description>Thank you Muthu...It worked......&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robs</description>
      <pubDate>Wed, 23 Nov 2005 05:42:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942496#M798316</guid>
      <dc:creator>Robert DJ</dc:creator>
      <dc:date>2005-11-23T05:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: date format with a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942497#M798317</link>
      <description>It worked......Thank you.</description>
      <pubDate>Wed, 23 Nov 2005 05:43:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/date-format-with-a-file/m-p/4942497#M798317</guid>
      <dc:creator>Robert DJ</dc:creator>
      <dc:date>2005-11-23T05:43:00Z</dc:date>
    </item>
  </channel>
</rss>

