<?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>discussione script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4643102#M676599</link>
    <description>I have around 20 directories dirA,dirB.... and there are 3 to 4 subdirectories subdirA, subdirB ...in each of these 20 directories. I have files of last month and the months before in these subdirectories. I would like to move these files for archival purposes by month to another directory in the the format /archive/dirA/subdirA/Feb2010 . Could someone guide me on how to do this.&lt;BR /&gt;&lt;BR /&gt;I have been doing this manually as below&lt;BR /&gt;cd to DirA and then use the below command&lt;BR /&gt;for i in `ls -l |grep Feb|awk '{print $9}'`&lt;BR /&gt;do&lt;BR /&gt;mkdir -p /archive/dirA/subdirA/Feb2010&lt;BR /&gt;mv $i /archive/dirA/subdirA/Feb2010&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This is taking quite a long time.</description>
    <pubDate>Sat, 05 Jun 2010 19:29:11 GMT</pubDate>
    <dc:creator>javedk</dc:creator>
    <dc:date>2010-06-05T19:29:11Z</dc:date>
    <item>
      <title>script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4643102#M676599</link>
      <description>I have around 20 directories dirA,dirB.... and there are 3 to 4 subdirectories subdirA, subdirB ...in each of these 20 directories. I have files of last month and the months before in these subdirectories. I would like to move these files for archival purposes by month to another directory in the the format /archive/dirA/subdirA/Feb2010 . Could someone guide me on how to do this.&lt;BR /&gt;&lt;BR /&gt;I have been doing this manually as below&lt;BR /&gt;cd to DirA and then use the below command&lt;BR /&gt;for i in `ls -l |grep Feb|awk '{print $9}'`&lt;BR /&gt;do&lt;BR /&gt;mkdir -p /archive/dirA/subdirA/Feb2010&lt;BR /&gt;mv $i /archive/dirA/subdirA/Feb2010&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This is taking quite a long time.</description>
      <pubDate>Sat, 05 Jun 2010 19:29:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4643102#M676599</guid>
      <dc:creator>javedk</dc:creator>
      <dc:date>2010-06-05T19:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4643103#M676600</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;You could try this (untested):&lt;BR /&gt;&lt;BR /&gt;# cat ./archiveit&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;for DIR in DirA DirB DirC #...etc...&lt;BR /&gt;do&lt;BR /&gt;    cd ${DIR} || exit 1&lt;BR /&gt;    for SUBDIR in subdirA surdirB subdirC #...etc&lt;BR /&gt;    do&lt;BR /&gt;        cd ${SUBDIR} || continue #...skip if missing...&lt;BR /&gt;        mkdir -p /archive/${DIR}/${SUBDIR}/Feb2010&lt;BR /&gt;        for FILE in $(ls -l|awk '{if ($6=="Feb") {print $9}}')&lt;BR /&gt;        do&lt;BR /&gt;            mv ${FILE} /archive/${DIR}/${SUBDIR}/Feb2010&lt;BR /&gt;        done&lt;BR /&gt;        cd .. #...back out of current SUBDIR...&lt;BR /&gt;    done&lt;BR /&gt;    cd .. #...backup out of current DIR...&lt;BR /&gt;done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 05 Jun 2010 20:17:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4643103#M676600</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-06-05T20:17:04Z</dc:date>
    </item>
  </channel>
</rss>

