<?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: perl regular expressions help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136244#M31441</link>
    <description>perl -n -e 'm#(.*/).*# and print $1 . "\n"' yourfile &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;A perl solution.</description>
    <pubDate>Sun, 27 Jan 2008 21:46:18 GMT</pubDate>
    <dc:creator>Stuart Browne</dc:creator>
    <dc:date>2008-01-27T21:46:18Z</dc:date>
    <item>
      <title>perl regular expressions help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136242#M31439</link>
      <description>I have a text file consist of the following.&lt;BR /&gt;/usr/bin/file1.txt&lt;BR /&gt;/home/user/file2.txt&lt;BR /&gt;/sbin/init.d/file3.txt&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;/etc/opt/file20.txt&lt;BR /&gt;&lt;BR /&gt;I wan't read the file and send the following output to text file or array.&lt;BR /&gt;&lt;BR /&gt;/usr/bin&lt;BR /&gt;/home/user&lt;BR /&gt;/sbin/init.d&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;/etc/opt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate all help.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;JC</description>
      <pubDate>Sun, 27 Jan 2008 19:12:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136242#M31439</guid>
      <dc:creator>Junior C.</dc:creator>
      <dc:date>2008-01-27T19:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: perl regular expressions help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136243#M31440</link>
      <description>You don't even need perl for that - it's easy enough with shell scripting:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;while read PATHNAME&lt;BR /&gt;do&lt;BR /&gt;    dirname "$PATHNAME"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Pipe in the input file and redirect the output to wherever you want:&lt;BR /&gt;&lt;BR /&gt;sh script.sh &lt;INPUTFILE.TXT&gt;outputfile.txt&lt;BR /&gt;&lt;BR /&gt;MK&lt;/INPUTFILE.TXT&gt;</description>
      <pubDate>Sun, 27 Jan 2008 21:04:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136243#M31440</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2008-01-27T21:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: perl regular expressions help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136244#M31441</link>
      <description>perl -n -e 'm#(.*/).*# and print $1 . "\n"' yourfile &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;A perl solution.</description>
      <pubDate>Sun, 27 Jan 2008 21:46:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136244#M31441</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2008-01-27T21:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: perl regular expressions help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136245#M31442</link>
      <description>Hi JC:&lt;BR /&gt;&lt;BR /&gt;Yet another Perl solution:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Basename -nle 'print dirname($_)' filenames&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sun, 27 Jan 2008 23:52:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-regular-expressions-help/m-p/4136245#M31442</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-27T23:52:19Z</dc:date>
    </item>
  </channel>
</rss>

