<?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: rename file script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579432#M229552</link>
    <description>Something like this?&lt;BR /&gt;&lt;BR /&gt;cd /target_dir&lt;BR /&gt;for FILE in ORD*&lt;BR /&gt;do&lt;BR /&gt;ln -s $FILE $FILEK&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I used the link command because you said you wanted to retain the original - normally I would have renamed with mv.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Mon, 11 Jul 2005 08:55:22 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2005-07-11T08:55:22Z</dc:date>
    <item>
      <title>rename file script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579431#M229551</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to rename multiple files within a dir whilst maintaining the old filename also. All files are of the format ORD?????? and I need to rename these to ORD??????K. &lt;BR /&gt;&lt;BR /&gt;Since there are hundreds of files in the dir I need to script this but unfortunately Iam not having much luck. Anybody any ideas?&lt;BR /&gt;&lt;BR /&gt;D.</description>
      <pubDate>Mon, 11 Jul 2005 08:49:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579431#M229551</guid>
      <dc:creator>Duffs</dc:creator>
      <dc:date>2005-07-11T08:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: rename file script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579432#M229552</link>
      <description>Something like this?&lt;BR /&gt;&lt;BR /&gt;cd /target_dir&lt;BR /&gt;for FILE in ORD*&lt;BR /&gt;do&lt;BR /&gt;ln -s $FILE $FILEK&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I used the link command because you said you wanted to retain the original - normally I would have renamed with mv.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 11 Jul 2005 08:55:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579432#M229552</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-07-11T08:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: rename file script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579433#M229553</link>
      <description>for i in ORD??????&lt;BR /&gt;do&lt;BR /&gt;mv $i ${i}K&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Jul 2005 08:56:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579433#M229553</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2005-07-11T08:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: rename file script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579434#M229554</link>
      <description>#!/usr/bin/ksh&lt;BR /&gt;for i in ORD??????&lt;BR /&gt;do&lt;BR /&gt;mv $i ${i}K&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Jul 2005 08:56:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579434#M229554</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2005-07-11T08:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: rename file script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579435#M229555</link>
      <description>done &lt;BR /&gt;of course&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Jul 2005 08:56:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579435#M229555</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2005-07-11T08:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: rename file script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579436#M229556</link>
      <description>You could do something like this:&lt;BR /&gt;&lt;BR /&gt;#usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;ls | grep -E -e '^ORD.{6}$' | while read FNAME&lt;BR /&gt;  do&lt;BR /&gt;     NEW_FNAME="${FNAME}K"&lt;BR /&gt;     if [[ -e "${NEW_FNAME}" ]]&lt;BR /&gt;       then&lt;BR /&gt;         echo "Can't copy ${NEW_FNAME}; file exists." &amp;gt;&amp;amp;2&lt;BR /&gt;       else&lt;BR /&gt;         cp "${FNAME}" "${NEW_FNAME}"&lt;BR /&gt;       fi&lt;BR /&gt;  done&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Jul 2005 09:01:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579436#M229556</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-07-11T09:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: rename file script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579437#M229557</link>
      <description>Thanks a millions lads, great help!&lt;BR /&gt;Cheers,&lt;BR /&gt;D.</description>
      <pubDate>Mon, 11 Jul 2005 09:21:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rename-file-script/m-p/3579437#M229557</guid>
      <dc:creator>Duffs</dc:creator>
      <dc:date>2005-07-11T09:21:03Z</dc:date>
    </item>
  </channel>
</rss>

