<?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: Regex in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097447#M63715</link>
    <description>You can also use sed to change the string:&lt;BR /&gt;echo $OLD | sed -e 's/_[0-9]\{8\}//'&lt;BR /&gt;&lt;BR /&gt;# Assuming a "." after the numbers&lt;BR /&gt;find path -name "*_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].*"&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 13 Mar 2008 11:20:43 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-03-13T11:20:43Z</dc:date>
    <item>
      <title>Regex</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097443#M63711</link>
      <description>&lt;P&gt;/usr/local/tomcat_staged_war_files/web_serv_8080/TestResults_WS_08120309.war&lt;BR /&gt;&lt;BR /&gt;Given the above string, how do I substitute the _08120309 resulting in:&lt;BR /&gt;/usr/local/tomcat_staged_war_files/web_serv_8080/TestResults_WS.war&lt;BR /&gt;&lt;BR /&gt;Also, How would I use 'find' to only find a file that contains this (_08120309) convention? This is a date string and is variable but alwas a '_' followed by 8 digits.&lt;BR /&gt;&lt;BR /&gt;Thanks !&lt;BR /&gt;&lt;BR /&gt;Mike&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. this thread has been moved&amp;nbsp;from Insight Remote Support&amp;gt;general to Linux &amp;gt; sysadmin - HP Forums Moderator&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jan 2013 09:00:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097443#M63711</guid>
      <dc:creator>Mike Boswell_1</dc:creator>
      <dc:date>2013-01-06T09:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097444#M63712</link>
      <description>Maybe the wrong forum.  I am scripting in bash on redhat.</description>
      <pubDate>Wed, 12 Mar 2008 15:22:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097444#M63712</guid>
      <dc:creator>Mike Boswell_1</dc:creator>
      <dc:date>2008-03-12T15:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Regex</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097445#M63713</link>
      <description>Hi Mike:&lt;BR /&gt;&lt;BR /&gt;F="/usr/local/tomcat_staged_war_files/web_serv_8080/TestResults_WS_08120309.war"&lt;BR /&gt;&lt;BR /&gt;# echo ${F}|perl -ple 's/_08120309//'&lt;BR /&gt;/usr/local/tomcat_staged_war_files/web_serv_8080/TestResults_WS.war&lt;BR /&gt;&lt;BR /&gt;# cd /path &amp;amp;&amp;amp; perl -MFile::Find -le 'find(sub{print if -f $_ &amp;amp;&amp;amp; m/_\d{8}/},".")'&lt;BR /&gt;&lt;BR /&gt;...The '\d' represents a digit and the '{8}' says eight of them, please.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 12 Mar 2008 15:23:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097445#M63713</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-03-12T15:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Regex</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097446#M63714</link>
      <description>Hi (again) Mike:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Maybe the wrong forum. I am scripting in bash on redhat.&lt;BR /&gt;&lt;BR /&gt;Well, Perl is universal :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 12 Mar 2008 15:25:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097446#M63714</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-03-12T15:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regex</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097447#M63715</link>
      <description>You can also use sed to change the string:&lt;BR /&gt;echo $OLD | sed -e 's/_[0-9]\{8\}//'&lt;BR /&gt;&lt;BR /&gt;# Assuming a "." after the numbers&lt;BR /&gt;find path -name "*_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].*"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Mar 2008 11:20:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097447#M63715</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-03-13T11:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097448#M63716</link>
      <description>James,  Thanks for your quick response.  I dont speak perl, so your solutions would be plagiarism on my part.  One day I will figure it out.  I do have a book but have never been able to get to far into it.  &lt;BR /&gt;&lt;BR /&gt;Dennis,  Sed is more my style, in fact I was trying to make that exact command work.  Looks like all I needed were the quotes.  What is the -e for?  It works w/ or wo/ it.   So, find and sed dont have the same regex capabilities, eh?&lt;BR /&gt;&lt;BR /&gt;Thanks Guys !</description>
      <pubDate>Thu, 13 Mar 2008 12:29:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097448#M63716</guid>
      <dc:creator>Mike Boswell_1</dc:creator>
      <dc:date>2008-03-13T12:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Regex</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097449#M63717</link>
      <description>Thanks again.</description>
      <pubDate>Thu, 13 Mar 2008 12:31:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097449#M63717</guid>
      <dc:creator>Mike Boswell_1</dc:creator>
      <dc:date>2008-03-13T12:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Regex</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097450#M63718</link>
      <description>&amp;gt;What is the -e for? It works w/ or wo/ it.&lt;BR /&gt;&lt;BR /&gt;Using -e allows you to have multiple scripts, same as grep.  It is a good habit to get into.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;find and sed don't have the same regex capabilities, eh? &lt;BR /&gt;&lt;BR /&gt;No.  See regexp(5):&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60130/regexp.5.html" target="_blank"&gt;http://docs.hp.com/en/B2355-60130/regexp.5.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;sed/grep takes Basic Regular Expressions&lt;BR /&gt;find/ls/shells take Pattern Matching Notation&lt;BR /&gt;awk/egrep/grep -e take Extended Regular Expressions&lt;BR /&gt;perl takes the kitchen sink.  :-)</description>
      <pubDate>Thu, 13 Mar 2008 12:53:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regex/m-p/5097450#M63718</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-03-13T12:53:21Z</dc:date>
    </item>
  </channel>
</rss>

