<?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: show files in a numeric range in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5362277#M639628</link>
    <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;last question : when i try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ls /tmp/20111010/file/file* | \&lt;BR /&gt;first=95 second=105 perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=$ENV{first} &amp;amp;&amp;amp; $n&amp;lt;=$ENV{second}'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it shows nothing , print $n shows 20111010 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ls /tmp/file/file* | \&lt;BR /&gt;first=95 second=105 perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=$ENV{first} &amp;amp;&amp;amp; $n&amp;lt;=$ENV{second}'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is ok&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2011 12:38:03 GMT</pubDate>
    <dc:creator>support_billa</dc:creator>
    <dc:date>2011-10-14T12:38:03Z</dc:date>
    <item>
      <title>show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5359803#M639623</link>
      <description>&lt;P&gt;In directories I have hundreds of files like:&lt;BR /&gt;&lt;BR /&gt;file0001.lst&lt;BR /&gt;file0002.lst&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;file0999.lst&lt;BR /&gt;&lt;BR /&gt;i want to show files in a index range, example 30 til 60 .&lt;BR /&gt;input : index1&lt;BR /&gt;input : index2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my idea:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;index1=$1&lt;BR /&gt;index2=$2&lt;BR /&gt;&lt;BR /&gt;for file in $( ls file* )&lt;BR /&gt;do&lt;BR /&gt;&amp;nbsp;index=$( basename ${file} .lst |sed "s|[a-z]||g" )&lt;BR /&gt;&amp;nbsp;if [ ${index} -ge ${index1} -a ${index} -le ${index2} ]&lt;BR /&gt;&amp;nbsp;then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ls -al $file&lt;BR /&gt;&amp;nbsp;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2011 08:19:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5359803#M639623</guid>
      <dc:creator>support_billa</dc:creator>
      <dc:date>2011-10-12T08:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5359947#M639624</link>
      <description>&lt;P&gt;If your format is always: file####.lst:&lt;/P&gt;&lt;P&gt;#!/usr/bin/ksh&lt;/P&gt;&lt;P&gt;# List files by range&lt;/P&gt;&lt;P&gt;if [ $# -ne 2 ]; then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; echo "Usage: $0 first last" 1&amp;gt;&amp;amp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; exit 1&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;typeset -i first=$1 second=$2&lt;/P&gt;&lt;P&gt;typeset -Z4 subnum&lt;/P&gt;&lt;P&gt;ls $(&lt;/P&gt;&lt;P&gt;while (( first &amp;lt;= second )); do&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; subnum=$first&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; echo "file$subnum.lst"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (( first += 1 ))&lt;/P&gt;&lt;P&gt;done) 2&amp;gt; /dev/null&amp;nbsp; # ignore missing files&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2011 10:53:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5359947#M639624</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-12T10:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5359951#M639625</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=30 &amp;amp;&amp;amp; $n&amp;lt;=60' file&lt;/PRE&gt; &lt;P&gt;...prints the names matching the criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# perl -nle '($n)=m{\D+(\d+)};system(qq(ls -l $_)) if $n&amp;gt;=30 &amp;amp;&amp;amp; $n&amp;lt;=60' file&lt;/PRE&gt; &lt;P&gt;...runs 'ls -l' on the matches.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2011 10:52:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5359951#M639625</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-10-12T10:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5360063#M639626</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;both answers are perfect, shell i understand , perl it isn't so easy, but i can extend to use shell variables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=30 &amp;amp;&amp;amp; $n&amp;lt;=60' file&lt;/PRE&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my version for using in a shell, hope right ?&lt;/P&gt;&lt;PRE&gt;ls file* | \
first=98 second=105 perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=$ENV{"first"} &amp;amp;&amp;amp; $n&amp;lt;=$ENV{"second"}' &lt;/PRE&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2011 12:20:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5360063#M639626</guid>
      <dc:creator>support_billa</dc:creator>
      <dc:date>2011-10-12T12:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5360081#M639627</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your Perl modification was very well done!&amp;nbsp; You can use barewords for the hash keys, though:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# ls file* | first=30 second=60 perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=$ENV{first} &amp;amp;&amp;amp; $n&amp;lt;=$ENV{second}'&lt;/PRE&gt; &lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2011 12:32:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5360081#M639627</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-10-12T12:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5362277#M639628</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;last question : when i try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ls /tmp/20111010/file/file* | \&lt;BR /&gt;first=95 second=105 perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=$ENV{first} &amp;amp;&amp;amp; $n&amp;lt;=$ENV{second}'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it shows nothing , print $n shows 20111010 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ls /tmp/file/file* | \&lt;BR /&gt;first=95 second=105 perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=$ENV{first} &amp;amp;&amp;amp; $n&amp;lt;=$ENV{second}'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is ok&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 12:38:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5362277#M639628</guid>
      <dc:creator>support_billa</dc:creator>
      <dc:date>2011-10-14T12:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5362295#M639629</link>
      <description>&lt;P&gt;&amp;gt;when I try:&amp;nbsp; ls /tmp/20111010/file/file* | \&lt;/P&gt;&lt;P&gt;&amp;gt;it shows nothing, print $n shows 20111010 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most likely it takes the first string of digits in your directory path and not the last in your filename?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 20:54:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5362295#M639629</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-14T20:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5362301#M639630</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/1195711"&gt;@support_billa&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;last question : when i try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ls /tmp/20111010/file/file* | \&lt;BR /&gt;first=95 second=105 perl -nle '($n)=m{\D+(\d+)};print if $n&amp;gt;=$ENV{first} &amp;amp;&amp;amp; $n&amp;lt;=$ENV{second}'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it shows nothing , print $n shows 20111010 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt; &lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's different about '/tmp/file/file' versus ' /tmp/20111010/file/file' ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is, show us what your 'ls' of each returns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 13:23:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5362301#M639630</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-10-14T13:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: show files in a numeric range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5363215#M639631</link>
      <description>&lt;P&gt;The number test should be done on the &lt;STRONG&gt;file&lt;/STRONG&gt;&amp;nbsp;name only if I read this thread correctly, not on the directory name. I'd use File::Find;&lt;/P&gt;&lt;PRE&gt;$ perl -MFile::Find -wle'find(sub{/(\d+)/&amp;amp;&amp;amp;$1&amp;gt;=95&amp;amp;&amp;amp;$1&amp;lt;=105&amp;amp;&amp;amp;print},"/tmp/20111010/file")'&lt;/PRE&gt; &lt;P&gt;&amp;nbsp;but you might find that too terse&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2011 15:34:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/show-files-in-a-numeric-range/m-p/5363215#M639631</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2011-10-16T15:34:19Z</dc:date>
    </item>
  </channel>
</rss>

