<?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: cp command with regular expressions in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869531#M278098</link>
    <description>Hi Danny,&lt;BR /&gt;&lt;BR /&gt;and this :&lt;BR /&gt;&lt;BR /&gt;cp measlog?? /tmp/testdir&lt;BR /&gt;&lt;BR /&gt;could meet your needs?&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;regards&lt;BR /&gt;pg</description>
    <pubDate>Tue, 26 Sep 2006 04:36:25 GMT</pubDate>
    <dc:creator>Piergiacomo Perini</dc:creator>
    <dc:date>2006-09-26T04:36:25Z</dc:date>
    <item>
      <title>cp command with regular expressions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869530#M278097</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have files with the following naming format:&lt;BR /&gt;measlog0, measlog2, measlog3, measlog4, measlog5, measlog6, measlog7, measlog8, measlog9, measlog10, measlog11.&lt;BR /&gt;&lt;BR /&gt;I'd like to copy these files to different directory, using "cp" command with some regular expressions:&lt;BR /&gt;&lt;BR /&gt;1) cp measlog[0-9]* /tmp/testdir&lt;BR /&gt;This option works well if there no other characters after the filename measlog&lt;NUMBER&gt; such as measlog9abc or measlog9_test&lt;BR /&gt;&lt;BR /&gt;I attempted a more secure method, but did not work:&lt;BR /&gt;bash-2.05$ cp measlog[0-9]*$ /tmp/testdir&lt;BR /&gt;cp: cannot access measlog[0-9]*$&lt;BR /&gt;&lt;BR /&gt;bash-2.05$ cp measlog[0-9]{2} /tmp/testdir&lt;BR /&gt;cp: cannot access measlog[0-9]{2}&lt;BR /&gt;&lt;BR /&gt;Could anyone show how I could use a more "secure" regular expression within "cp" to ensure files like measlog0, measlog1 ... measlog11 (i.e. measlog&lt;NUMBER&gt;) are the only files copied over?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Danny&lt;BR /&gt;&lt;/NUMBER&gt;&lt;/NUMBER&gt;</description>
      <pubDate>Tue, 26 Sep 2006 04:21:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869530#M278097</guid>
      <dc:creator>Danny Fang</dc:creator>
      <dc:date>2006-09-26T04:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: cp command with regular expressions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869531#M278098</link>
      <description>Hi Danny,&lt;BR /&gt;&lt;BR /&gt;and this :&lt;BR /&gt;&lt;BR /&gt;cp measlog?? /tmp/testdir&lt;BR /&gt;&lt;BR /&gt;could meet your needs?&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;regards&lt;BR /&gt;pg</description>
      <pubDate>Tue, 26 Sep 2006 04:36:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869531#M278098</guid>
      <dc:creator>Piergiacomo Perini</dc:creator>
      <dc:date>2006-09-26T04:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: cp command with regular expressions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869532#M278099</link>
      <description>Danny,&lt;BR /&gt;cp measlog*[0-9] /tmp/testdir</description>
      <pubDate>Tue, 26 Sep 2006 04:37:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869532#M278099</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-09-26T04:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: cp command with regular expressions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869533#M278100</link>
      <description>Hi again Danny,&lt;BR /&gt;&lt;BR /&gt;or try &lt;BR /&gt;&lt;BR /&gt;cp measlog[0-90-9] /tmp/testdir&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;pg</description>
      <pubDate>Tue, 26 Sep 2006 04:43:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869533#M278100</guid>
      <dc:creator>Piergiacomo Perini</dc:creator>
      <dc:date>2006-09-26T04:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: cp command with regular expressions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869534#M278101</link>
      <description>Hi, Danny,&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;for fn in measlog*&lt;BR /&gt;do cp $fn /tmp/testdir&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Yang</description>
      <pubDate>Tue, 26 Sep 2006 04:47:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869534#M278101</guid>
      <dc:creator>Yang Qin_1</dc:creator>
      <dc:date>2006-09-26T04:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: cp command with regular expressions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869535#M278102</link>
      <description>Since there are two different forms of the filename, you have to use two expressions like this:&lt;BR /&gt; &lt;BR /&gt;cp measlog[0-9] measlog[0-9][0-9] /somedir&lt;BR /&gt; &lt;BR /&gt;As always, test the list with echo first:&lt;BR /&gt; &lt;BR /&gt;echo cp measlog[0-9] measlog[0-9][0-9] /somedir&lt;BR /&gt; &lt;BR /&gt;cp knows nothing about regular expresions (or more accurately, filename generation) so the echo will show you what cp will see.</description>
      <pubDate>Tue, 26 Sep 2006 06:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869535#M278102</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-09-26T06:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: cp command with regular expressions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869536#M278103</link>
      <description>Danny,&lt;BR /&gt;can you please update with any feedback.&lt;BR /&gt;&lt;BR /&gt;If the problem is resolved, could you please identify the solution, rewards any helpful answers and close the thread.&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Sep 2006 04:25:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869536#M278103</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-09-27T04:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: cp command with regular expressions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869537#M278104</link>
      <description>Hi everyone,&lt;BR /&gt;Issue resolved by using the method suggested by Peter, i.e.:&lt;BR /&gt;cp measlog*[0-9] /tmp/testdir&lt;BR /&gt;&lt;BR /&gt;Thank you all for your help.</description>
      <pubDate>Thu, 28 Sep 2006 01:41:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cp-command-with-regular-expressions/m-p/3869537#M278104</guid>
      <dc:creator>Danny Fang</dc:creator>
      <dc:date>2006-09-28T01:41:01Z</dc:date>
    </item>
  </channel>
</rss>

