<?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: ls -lR Script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794673#M80643</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;Put&lt;BR /&gt;&lt;BR /&gt;typeset -i count=0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;let count=$count+1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In place of the 2 current lines&lt;BR /&gt;count=0&lt;BR /&gt;count=`expr $count + 1` &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;               steve steel</description>
    <pubDate>Tue, 27 Aug 2002 06:50:27 GMT</pubDate>
    <dc:creator>Steve Steel</dc:creator>
    <dc:date>2002-08-27T06:50:27Z</dc:date>
    <item>
      <title>ls -lR Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794672#M80642</link>
      <description>HI,&lt;BR /&gt;&lt;BR /&gt;I have a file containing lists of filesystems:&lt;BR /&gt;#cat file1&lt;BR /&gt;/fs12/my_circuit&lt;BR /&gt;/fs13/schematics&lt;BR /&gt;/fs17/layout_archives&lt;BR /&gt;/fs21/chip_design&lt;BR /&gt;(and the list continues ...)&lt;BR /&gt;&lt;BR /&gt;I would like to do an ls -lR for each of these filesystems in file1 and save the ls -lR of each of these filesystems into another file, i.e 1.txt, 2.txt, 3.txt to represent the 1st, 2nd, 3rd etc... filesystems from file1.&lt;BR /&gt;e.g:&lt;BR /&gt; /fs12/my_circuit should be stored in 1.txt&lt;BR /&gt; /fs13/schematics should be stored in 2.txt&lt;BR /&gt; /fs17/layout_archives should be stored in 3.txt&lt;BR /&gt;  &lt;BR /&gt;I did the following:&lt;BR /&gt;#cat myscript.sh&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;count=0&lt;BR /&gt;for i in `cat file1`&lt;BR /&gt;do&lt;BR /&gt;   count=`expr $count + 1`&lt;BR /&gt;   ls -lR $i &amp;gt;&amp;gt; "$count".txt&lt;BR /&gt;   count=`expr count`&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Unfortunately, the filenames take the form of:&lt;BR /&gt;0.txt, 0+1.txt, 0+1+1.txt, 0+1+1+1.txt for the 1st, 2nd, etc filesystems to stored in the. &lt;BR /&gt; &lt;BR /&gt;It would be best, however, if I could have the names of each files to be exactly similar to that of the filesystems i.e.:&lt;BR /&gt;/fs12/my_circuit should be stored in fs12/my_circuit.txt &lt;BR /&gt;&lt;BR /&gt;/fs13/schematics should be stored in fs13/schematics.txt &lt;BR /&gt;&lt;BR /&gt;Could someone show me the correct way of doing this? i.e as in having the filenames 1.txt, 2.txt OR even best, as in fs13/schematics.txt, fs12/my_circuit.txt ??  &lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Aug 2002 06:47:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794672#M80642</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-08-27T06:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: ls -lR Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794673#M80643</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Put&lt;BR /&gt;&lt;BR /&gt;typeset -i count=0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;let count=$count+1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In place of the 2 current lines&lt;BR /&gt;count=0&lt;BR /&gt;count=`expr $count + 1` &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;               steve steel</description>
      <pubDate>Tue, 27 Aug 2002 06:50:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794673#M80643</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-08-27T06:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: ls -lR Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794674#M80644</link>
      <description>Try this;&lt;BR /&gt;&lt;BR /&gt;for i in $(cat file1)&lt;BR /&gt;do&lt;BR /&gt;ls -lR $i &amp;gt; ${i}.txt&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Aug 2002 06:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794674#M80644</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-08-27T06:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: ls -lR Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794675#M80645</link>
      <description>Hi Chern,&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;cat myscript.sh &lt;BR /&gt;#!/bin/sh &lt;BR /&gt;integer count=0 &lt;BR /&gt;for i in `cat file1` &lt;BR /&gt;do &lt;BR /&gt;(( count = $count + 1 )) &lt;BR /&gt;ls -lR ${i} &amp;gt;&amp;gt; ${count}.txt &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Or:&lt;BR /&gt;#!/bin/sh &lt;BR /&gt;for i in `cat file1` &lt;BR /&gt;do &lt;BR /&gt;fich=$(echo ${i} | sed 's/\//_/g')&lt;BR /&gt;ls -lR ${i} &amp;gt;&amp;gt; ${fich}.txt &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Aug 2002 06:53:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794675#M80645</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2002-08-27T06:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: ls -lR Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794676#M80646</link>
      <description>Try using&lt;BR /&gt;ls -lR $i &amp;gt;&amp;gt; "$i".txt &lt;BR /&gt;instead of&lt;BR /&gt;ls -lR $i &amp;gt;&amp;gt; "$count".txt</description>
      <pubDate>Tue, 27 Aug 2002 06:54:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794676#M80646</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-08-27T06:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: ls -lR Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794677#M80647</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Forgot&lt;BR /&gt;&lt;BR /&gt;do not need &lt;BR /&gt;count='expr count' &lt;BR /&gt;if you follow my previous answer&lt;BR /&gt;&lt;BR /&gt;Also&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; $(echo $i|sed -e 's:/:\\:g')"_"$count".txt"&lt;BR /&gt;&lt;BR /&gt;will give name \fs12\my_circuit_1.txt so you do&lt;BR /&gt;not need to make subdirectories but can recognise what it is.&lt;BR /&gt;&lt;BR /&gt;              steve steel</description>
      <pubDate>Tue, 27 Aug 2002 07:14:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794677#M80647</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-08-27T07:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: ls -lR Script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794678#M80648</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;while read file&lt;BR /&gt;do&lt;BR /&gt;ls -lR $file &amp;gt;`basename $file`.txt&lt;BR /&gt;done</description>
      <pubDate>Tue, 27 Aug 2002 07:26:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-lr-script-problem/m-p/2794678#M80648</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-08-27T07:26:21Z</dc:date>
    </item>
  </channel>
</rss>

