<?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: for loop + shell scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040481#M432811</link>
    <description>Closed</description>
    <pubDate>Tue, 17 Apr 2007 04:36:19 GMT</pubDate>
    <dc:creator>network_4</dc:creator>
    <dc:date>2007-04-17T04:36:19Z</dc:date>
    <item>
      <title>for loop + shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040475#M432805</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Issue is i have a list of files and have to delete all files one by one but i am not able to use for loop. Actually there is one directory where some files like a1, a2 a3 will be there and we have to move files on the basis of lowest seqence file first. So let me know how we can do this.</description>
      <pubDate>Tue, 17 Apr 2007 00:47:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040475#M432805</guid>
      <dc:creator>network_4</dc:creator>
      <dc:date>2007-04-17T00:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: for loop + shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040476#M432806</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;How about a while loop&lt;BR /&gt;&lt;BR /&gt;ls -1 &amp;gt; list&lt;BR /&gt;&lt;BR /&gt;filetonotdelete=nodelete.dat&lt;BR /&gt;&lt;BR /&gt;while read -r filename&lt;BR /&gt;do&lt;BR /&gt;   if [ "$filename" != "$filetonotdelete" ]&lt;BR /&gt;   then&lt;BR /&gt;       echo "Not deleting $filetonotdelete"&lt;BR /&gt;   else&lt;BR /&gt;       echo "Deleting $filename"&lt;BR /&gt;       rm -f $filename&lt;BR /&gt;   fi &lt;BR /&gt;done &amp;lt; list&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 17 Apr 2007 00:58:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040476#M432806</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-04-17T00:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: for loop + shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040477#M432807</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Give details of file sequence &amp;amp; Some examples.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Apr 2007 01:20:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040477#M432807</guid>
      <dc:creator>SANTOSH S. MHASKAR</dc:creator>
      <dc:date>2007-04-17T01:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: for loop + shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040478#M432808</link>
      <description>&lt;!--!*#--&gt;This is not a clear description, but if you&lt;BR /&gt;want to keep "a3", you might use something&lt;BR /&gt;like this:&lt;BR /&gt;&lt;BR /&gt;$ cat pur.sh&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;ls -1 $1 | \&lt;BR /&gt;(&lt;BR /&gt;  read c&lt;BR /&gt;  while [ -n "$c" ] ; do&lt;BR /&gt;    p="$c"&lt;BR /&gt;    read c&lt;BR /&gt;    if [ -n "$c" ] ; then&lt;BR /&gt;      rm "$p"&lt;BR /&gt;    fi&lt;BR /&gt;  done&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;./pur.sh "a*"&lt;BR /&gt;&lt;BR /&gt;But that would break when you got up to&lt;BR /&gt;"a10".&lt;BR /&gt;&lt;BR /&gt;Until you can say exactly what you would like&lt;BR /&gt;to do, there is not much hope of figuring out&lt;BR /&gt;how to do it.  After that, it's a lot like&lt;BR /&gt;writing a computer program.</description>
      <pubDate>Tue, 17 Apr 2007 01:39:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040478#M432808</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-04-17T01:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: for loop + shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040479#M432809</link>
      <description>&amp;gt;Issue is i have a list of files and have to delete all files one by one&lt;BR /&gt;&lt;BR /&gt;If you know what files you want to save, remove them from your list.  Then to remove the rest with:&lt;BR /&gt;$ rm -f $( &amp;lt; list-of-files )&lt;BR /&gt;&lt;BR /&gt;(This assumes they fit within the shell's command line.)</description>
      <pubDate>Tue, 17 Apr 2007 04:23:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040479#M432809</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-17T04:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: for loop + shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040480#M432810</link>
      <description>Thread Closed</description>
      <pubDate>Tue, 17 Apr 2007 04:35:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040480#M432810</guid>
      <dc:creator>network_4</dc:creator>
      <dc:date>2007-04-17T04:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: for loop + shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040481#M432811</link>
      <description>Closed</description>
      <pubDate>Tue, 17 Apr 2007 04:36:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/for-loop-shell-scripting/m-p/5040481#M432811</guid>
      <dc:creator>network_4</dc:creator>
      <dc:date>2007-04-17T04:36:19Z</dc:date>
    </item>
  </channel>
</rss>

