<?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: shell tricks in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907498#M838397</link>
    <description>if you want the output to include SCANTU as well&lt;BR /&gt;&lt;BR /&gt;ls &lt;FILE_NAME_HERE&gt; | cut -d. -f1-2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if not &lt;BR /&gt;&lt;BR /&gt;ls &lt;FILE_NAME_HERE&gt; | cut -d. -f1&lt;BR /&gt;&lt;BR /&gt;if you have multiple file like treasury* you can put thw wildcard pattern instead of filename here as well.&lt;BR /&gt;&lt;BR /&gt;hope it helps&lt;/FILE_NAME_HERE&gt;&lt;/FILE_NAME_HERE&gt;</description>
    <pubDate>Wed, 15 Jun 2005 12:05:22 GMT</pubDate>
    <dc:creator>Mel Burslan</dc:creator>
    <dc:date>2005-06-15T12:05:22Z</dc:date>
    <item>
      <title>shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907494#M838393</link>
      <description>I have a file like this:&lt;BR /&gt;&lt;BR /&gt;treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log&lt;BR /&gt;&lt;BR /&gt;i need to strip off eveything after SCANTU.&lt;BR /&gt;&lt;BR /&gt;how can i do this?&lt;BR /&gt;&lt;BR /&gt;thanks!&lt;BR /&gt;Phil&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Jun 2005 11:53:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907494#M838393</guid>
      <dc:creator>Philip J. Priest_1</dc:creator>
      <dc:date>2005-06-15T11:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907495#M838394</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Use "ls treasury*|cut -c1-22"&lt;BR /&gt;&lt;BR /&gt;Enjoy :)</description>
      <pubDate>Wed, 15 Jun 2005 11:58:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907495#M838394</guid>
      <dc:creator>Pedro Cirne</dc:creator>
      <dc:date>2005-06-15T11:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907496#M838395</link>
      <description>Phil; try this&lt;BR /&gt;&lt;BR /&gt;filename=treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log&lt;BR /&gt;newfilename=`echo $filename | cut -d"." -f1`&lt;BR /&gt; &lt;BR /&gt;the newfilename shouldbe "treasury_server"&lt;BR /&gt;&lt;BR /&gt;Hope it helps.</description>
      <pubDate>Wed, 15 Jun 2005 12:00:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907496#M838395</guid>
      <dc:creator>Juan M Leon</dc:creator>
      <dc:date>2005-06-15T12:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907497#M838396</link>
      <description>awk -F "." '{print $1,$2}' "your_file"&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Wed, 15 Jun 2005 12:00:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907497#M838396</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-06-15T12:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907498#M838397</link>
      <description>if you want the output to include SCANTU as well&lt;BR /&gt;&lt;BR /&gt;ls &lt;FILE_NAME_HERE&gt; | cut -d. -f1-2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if not &lt;BR /&gt;&lt;BR /&gt;ls &lt;FILE_NAME_HERE&gt; | cut -d. -f1&lt;BR /&gt;&lt;BR /&gt;if you have multiple file like treasury* you can put thw wildcard pattern instead of filename here as well.&lt;BR /&gt;&lt;BR /&gt;hope it helps&lt;/FILE_NAME_HERE&gt;&lt;/FILE_NAME_HERE&gt;</description>
      <pubDate>Wed, 15 Jun 2005 12:05:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907498#M838397</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-06-15T12:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907499#M838398</link>
      <description>How about-&lt;BR /&gt; &lt;BR /&gt;x="treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log"&lt;BR /&gt;echo ${x%SCANTU*}&lt;BR /&gt; &lt;BR /&gt;This will strip off the SCANTU also, but you could add that back on...&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 15 Jun 2005 12:35:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907499#M838398</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-06-15T12:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907500#M838399</link>
      <description>Slight variation on RAC's solution...&lt;BR /&gt;&lt;BR /&gt;echo treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log | awk -F".1" '{print $1}'&lt;BR /&gt;&lt;BR /&gt;enjoy!</description>
      <pubDate>Wed, 15 Jun 2005 17:43:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907500#M838399</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-06-15T17:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907501#M838400</link>
      <description>You can do as,&lt;BR /&gt;&lt;BR /&gt;echo treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log | sed 's/SCANTU.*/SCANTU/'&lt;BR /&gt;&lt;BR /&gt;echo treasury_server.SCANTU.1.205.219.16.253.06-14-05.09:42:57.log | cut -d '.' -f1,2&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Jun 2005 22:50:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907501#M838400</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-06-15T22:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907502#M838401</link>
      <description>Rodney's approach is by far fastest one, since it does not use external commands. All others are breaking a fly on a wheel, IMHO.</description>
      <pubDate>Thu, 16 Jun 2005 05:05:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907502#M838401</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2005-06-16T05:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: shell tricks</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907503#M838402</link>
      <description>All of these are good. I used awk.&lt;BR /&gt;Thanks for everyone who responded!&lt;BR /&gt;&lt;BR /&gt;Phil</description>
      <pubDate>Thu, 16 Jun 2005 09:08:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-tricks/m-p/4907503#M838402</guid>
      <dc:creator>Philip J. Priest_1</dc:creator>
      <dc:date>2005-06-16T09:08:18Z</dc:date>
    </item>
  </channel>
</rss>

