<?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 Extract date also in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732144#M789329</link>
    <description>Greetings,&lt;BR /&gt;&lt;BR /&gt;Thanks again for all the help with the du command. I'm now trying to find a way to pull out the date attached to each file. Can this be tacked on to this 'du -akx | sort -rn | sort -k 2,2 | more &amp;gt; file.lst'?</description>
    <pubDate>Wed, 15 Feb 2006 10:46:01 GMT</pubDate>
    <dc:creator>Conrad J Wyrzykowski</dc:creator>
    <dc:date>2006-02-15T10:46:01Z</dc:date>
    <item>
      <title>Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732144#M789329</link>
      <description>Greetings,&lt;BR /&gt;&lt;BR /&gt;Thanks again for all the help with the du command. I'm now trying to find a way to pull out the date attached to each file. Can this be tacked on to this 'du -akx | sort -rn | sort -k 2,2 | more &amp;gt; file.lst'?</description>
      <pubDate>Wed, 15 Feb 2006 10:46:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732144#M789329</guid>
      <dc:creator>Conrad J Wyrzykowski</dc:creator>
      <dc:date>2006-02-15T10:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732145#M789330</link>
      <description>Conrad,&lt;BR /&gt;&lt;BR /&gt;The du command does nothing with dates - you could do something like this, however:&lt;BR /&gt;&lt;BR /&gt;for FILE in `cat file.lst`&lt;BR /&gt;do&lt;BR /&gt;ll $FILE | awk '{ print $6 " " $7 " " $8 " " }'&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 15 Feb 2006 10:56:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732145#M789330</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-02-15T10:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732146#M789331</link>
      <description>Yes, take out the more pipe it to awk&lt;BR /&gt;&lt;BR /&gt;| awk '{print $3}'&lt;BR /&gt;&lt;BR /&gt;change the $3 to include the date fields.&lt;BR /&gt;&lt;BR /&gt;Or process to a file and then cat the file through awk.&lt;BR /&gt;&lt;BR /&gt;There are a few good ways to do this.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 15 Feb 2006 10:56:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732146#M789331</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-02-15T10:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732147#M789332</link>
      <description>Conrad,&lt;BR /&gt;can you please clarify:&lt;BR /&gt;du does not include the date at any stage.&lt;BR /&gt;&lt;BR /&gt;Or &lt;BR /&gt;Do you mean include the date in the filename:&lt;BR /&gt;du -akx | sort -rn | sort -k 2,2 | more &amp;gt; `date +"%C%Y%m%d"`.lis&lt;BR /&gt;See man date  for format&lt;BR /&gt;&lt;BR /&gt;Or&lt;BR /&gt;If you want to see the date for each entry in your file you would have to use ls -ld</description>
      <pubDate>Wed, 15 Feb 2006 10:58:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732147#M789332</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-02-15T10:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732148#M789333</link>
      <description>I guess I wasn't clear enough on this. The current output file does not have the date field in it. I would like to have it in the output file. Currently I get something like this;&lt;BR /&gt;143600 ./scans/MCI. I would like to get this along with the date.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Conrad</description>
      <pubDate>Wed, 15 Feb 2006 11:04:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732148#M789333</guid>
      <dc:creator>Conrad J Wyrzykowski</dc:creator>
      <dc:date>2006-02-15T11:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732149#M789334</link>
      <description>Hi Conrad:&lt;BR /&gt;&lt;BR /&gt;Well, you could do something crude like this:&lt;BR /&gt;&lt;BR /&gt;# du -axk | sort -k1nr | perl -lanF -e ';print "$F[0]\t$F[1] : ",scalar  localtime ((stat($F[1]))[9])'  &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 15 Feb 2006 11:21:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732149#M789334</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-15T11:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732150#M789335</link>
      <description>Thanks James,&lt;BR /&gt;&lt;BR /&gt;It works, sort of. I can't run it as root but I can live with that I guess. I also modified it back to sort the way it was before I just wanted to include the date tag.&lt;BR /&gt;&lt;BR /&gt;du -akx | sort -rn | sort -k 2,2 | perl -lanF -e ';print "$F[0]\t$F[1] : ",scalar localtime ((stat($F[1]))[9])' &amp;gt; outfile.lst&lt;BR /&gt;&lt;BR /&gt;It seems that when I try and run it as root, root can't find perl. I get 'sh: perl: not found.'&lt;BR /&gt;&lt;BR /&gt;Thanks for all the help,&lt;BR /&gt;Conrad</description>
      <pubDate>Wed, 15 Feb 2006 12:09:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732150#M789335</guid>
      <dc:creator>Conrad J Wyrzykowski</dc:creator>
      <dc:date>2006-02-15T12:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732151#M789336</link>
      <description>Conrad,&lt;BR /&gt;probably means the perl executable in not in your PATH.&lt;BR /&gt;Once you found perl, just add it to your path:&lt;BR /&gt;export PATH=$PATH:&lt;PATH_TO_PERL&gt;&lt;/PATH_TO_PERL&gt;</description>
      <pubDate>Wed, 15 Feb 2006 12:12:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732151#M789336</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-02-15T12:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732152#M789337</link>
      <description>Thanks gordon,&lt;BR /&gt;&lt;BR /&gt;It runs now if I switch to su - but it still does not work if I switch to su.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Conrad</description>
      <pubDate>Wed, 15 Feb 2006 12:50:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732152#M789337</guid>
      <dc:creator>Conrad J Wyrzykowski</dc:creator>
      <dc:date>2006-02-15T12:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date also</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732153#M789338</link>
      <description>Hi (again) Conrad:&lt;BR /&gt;&lt;BR /&gt;The difference between 'su' and 'su -' allowing you to see perl points to a PATH issue.&lt;BR /&gt;&lt;BR /&gt;If you execute 'su -' you are sourcing the profile of the user to which you are switching, otherwise you are not.&lt;BR /&gt;&lt;BR /&gt;As Gordon said, you need to add perl to your path.  It maybe that perl is installed in '/opt/perl/bin/perl' but this isn't in your path.  An easy choice is to create a symbolic link :&lt;BR /&gt;&lt;BR /&gt;# ln -s /opt/perl/bin/perl /usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;Now, since '/usr/bin' will be in your path, so will 'perl'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 15 Feb 2006 12:54:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-date-also/m-p/3732153#M789338</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-15T12:54:58Z</dc:date>
    </item>
  </channel>
</rss>

