<?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 Script help please in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699131#M932545</link>
    <description>Help from script experts please.&lt;BR /&gt;&lt;BR /&gt;Dir listing gives these file names &lt;BR /&gt;&lt;BR /&gt;uv8980926993aa&lt;BR /&gt;uv8981027062aa&lt;BR /&gt;us9105010894aa&lt;BR /&gt;us9047009985aa&lt;BR /&gt;&lt;BR /&gt;I require to pull out the 3 to 7th chars,&lt;BR /&gt;&lt;BR /&gt;I.e.&lt;BR /&gt;uv8980926993aa &lt;BR /&gt;to become &lt;BR /&gt;89809&lt;BR /&gt;&lt;BR /&gt;I have got this far :-&lt;BR /&gt;&lt;BR /&gt;ll | awk '{print $9}' | sed "s/^uv//" | sed "s/^us//" | sed "s/aa//"&lt;BR /&gt;&lt;BR /&gt;To give this:-&lt;BR /&gt;&lt;BR /&gt;8980926993&lt;BR /&gt;8981027062&lt;BR /&gt;9105010894&lt;BR /&gt;9047009985&lt;BR /&gt;&lt;BR /&gt;But what next ??&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance &lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;</description>
    <pubDate>Mon, 08 Apr 2002 12:35:55 GMT</pubDate>
    <dc:creator>Paula J Frazer-Campbell</dc:creator>
    <dc:date>2002-04-08T12:35:55Z</dc:date>
    <item>
      <title>Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699131#M932545</link>
      <description>Help from script experts please.&lt;BR /&gt;&lt;BR /&gt;Dir listing gives these file names &lt;BR /&gt;&lt;BR /&gt;uv8980926993aa&lt;BR /&gt;uv8981027062aa&lt;BR /&gt;us9105010894aa&lt;BR /&gt;us9047009985aa&lt;BR /&gt;&lt;BR /&gt;I require to pull out the 3 to 7th chars,&lt;BR /&gt;&lt;BR /&gt;I.e.&lt;BR /&gt;uv8980926993aa &lt;BR /&gt;to become &lt;BR /&gt;89809&lt;BR /&gt;&lt;BR /&gt;I have got this far :-&lt;BR /&gt;&lt;BR /&gt;ll | awk '{print $9}' | sed "s/^uv//" | sed "s/^us//" | sed "s/aa//"&lt;BR /&gt;&lt;BR /&gt;To give this:-&lt;BR /&gt;&lt;BR /&gt;8980926993&lt;BR /&gt;8981027062&lt;BR /&gt;9105010894&lt;BR /&gt;9047009985&lt;BR /&gt;&lt;BR /&gt;But what next ??&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance &lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Apr 2002 12:35:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699131#M932545</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-04-08T12:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699132#M932546</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;ll | awk '{print substr($9,3,5)}' &lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 08 Apr 2002 12:39:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699132#M932546</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-04-08T12:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699133#M932547</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;What is about :&lt;BR /&gt;&lt;BR /&gt;ll | awk '{print $9}' | cut -c3-7&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Fr??d??ric</description>
      <pubDate>Mon, 08 Apr 2002 12:40:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699133#M932547</guid>
      <dc:creator>Frederic Sevestre</dc:creator>
      <dc:date>2002-04-08T12:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699134#M932548</link>
      <description>Try using 'cut':&lt;BR /&gt;&lt;BR /&gt;$ ls | cut -c 3-7&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
      <pubDate>Mon, 08 Apr 2002 12:41:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699134#M932548</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2002-04-08T12:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699135#M932549</link>
      <description>or&lt;BR /&gt;&lt;BR /&gt;ll | awk '{print $9}' | sed "s/uv\([0-9]\{5\}\)\(.*$\)/\1/"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 08 Apr 2002 12:46:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699135#M932549</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-04-08T12:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699136#M932550</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;This to check.script with dir as parameter&lt;BR /&gt;&lt;BR /&gt;file=$1&lt;BR /&gt;for f in $(ls -1 $file|sed -e 's:^.*/::g')&lt;BR /&gt;do&lt;BR /&gt;echo $f"|"$(echo $f|cut -c3-7)&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This to do your option.&lt;BR /&gt;&lt;BR /&gt;file=$1&lt;BR /&gt;for f in $(ls -1 $file|sed -e 's:^.*/::g')&lt;BR /&gt;do&lt;BR /&gt;echo $(echo $f|cut -c3-7)&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;               Steve Steel</description>
      <pubDate>Mon, 08 Apr 2002 12:47:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699136#M932550</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-04-08T12:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699137#M932551</link>
      <description>Hi Paula&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Try this&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ls | awk '{print$9}' | cut -c 3-7&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Mon, 08 Apr 2002 12:47:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699137#M932551</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-04-08T12:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699138#M932552</link>
      <description>Hi, just use&lt;BR /&gt;cat input | cut 3-7&lt;BR /&gt;&lt;BR /&gt;Greetings,&lt;BR /&gt;Ceesjan</description>
      <pubDate>Mon, 08 Apr 2002 12:47:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699138#M932552</guid>
      <dc:creator>Ceesjan van Hattum</dc:creator>
      <dc:date>2002-04-08T12:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699139#M932553</link>
      <description>Woa&lt;BR /&gt;&lt;BR /&gt;Enough already ---&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I will check out and assign points.&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Mon, 08 Apr 2002 13:04:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699139#M932553</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-04-08T13:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699140#M932554</link>
      <description>Hi Paula:&lt;BR /&gt;&lt;BR /&gt;Just for grins-and-giggles (although Harry's first solution using the 'substr' function of 'awk' my choice too):&lt;BR /&gt;&lt;BR /&gt;# ls -l|tr -s " " "\t"|cut -f9|cut -c3-7&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 08 Apr 2002 13:13:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699140#M932554</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-04-08T13:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699141#M932555</link>
      <description>Hi Paula,&lt;BR /&gt;&lt;BR /&gt;More confusion...&lt;BR /&gt;&lt;BR /&gt;If use ll, "grep -v ^total" needs to be added.  I'd use ls instead of ll.  You can explicitly say "ls -1" for one column output but ls will do that by default when it's output is piped to another command.&lt;BR /&gt;&lt;BR /&gt;My vote for speed and simplicity is Steven Gillard's:&lt;BR /&gt;ls | cut -c 3-7&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Mon, 08 Apr 2002 13:38:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699141#M932555</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-04-08T13:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699142#M932556</link>
      <description>Paula,&lt;BR /&gt;&lt;BR /&gt;Playing with the uv spool files I see!  Keep in mind that sometimes files in the directory no longer will be in the uv index file and therefore will not be accessible as hold entries from the uv commandline. OTOH, this also means that you can safely wack them, as far as uv is concerned.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark</description>
      <pubDate>Mon, 08 Apr 2002 13:48:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699142#M932556</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-04-08T13:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699143#M932557</link>
      <description>Mark&lt;BR /&gt;&lt;BR /&gt;Yes wonderful universe - I am writing an old file cleanup routine and intend to fire my results at:-&lt;BR /&gt;&lt;BR /&gt;usm -k &lt;RESULTS&gt; &lt;BR /&gt;&lt;BR /&gt;As as you know Unix file name and Universe file name when using the usm are different.&lt;BR /&gt;&lt;BR /&gt;Instead of just doing an rm on them I thought it safer to let the universe command deal with them.&lt;BR /&gt;&lt;BR /&gt;Et Al.&lt;BR /&gt;&lt;BR /&gt;All answer were worth 10 points - there is certainly more than one way to skin a cat.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;:^)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Paula&lt;/RESULTS&gt;</description>
      <pubDate>Mon, 08 Apr 2002 14:05:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699143#M932557</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-04-08T14:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699144#M932558</link>
      <description>Paula,&lt;BR /&gt;&lt;BR /&gt;Yes, been there, done that.  Some caveats: you have to run this as root, but you can do it in cron.  You also have to allow for the usm command to fail because the entry in the uv index is gone, so it won't remove the file. You can get around that like this:&lt;BR /&gt;&lt;BR /&gt;usm -k &lt;RESULTS&gt; || rm -f [file]&lt;BR /&gt;&lt;BR /&gt;also be aware that not all of the usm/usa command options work, or work as advertised.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark&lt;/RESULTS&gt;</description>
      <pubDate>Mon, 08 Apr 2002 14:33:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699144#M932558</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-04-08T14:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Script help please</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699145#M932559</link>
      <description>l1:/tmp 107 &amp;gt; ls u*&lt;BR /&gt;us9047009985aa  us9105010894aa  uv8980926993aa  uv8981027062aa&lt;BR /&gt;l1:/tmp 108 &amp;gt; perl -le 'for(grep s/^u[vs](\d{5}).*/$1/, &lt;U&gt;) { print }'&lt;BR /&gt;90470&lt;BR /&gt;91050&lt;BR /&gt;89809&lt;BR /&gt;89810&lt;BR /&gt;l1:/tmp 109 &amp;gt;&lt;BR /&gt;&lt;/U&gt;</description>
      <pubDate>Mon, 08 Apr 2002 14:43:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-please/m-p/2699145#M932559</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-04-08T14:43:05Z</dc:date>
    </item>
  </channel>
</rss>

