<?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: who do I do a substr ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857999#M95378</link>
    <description>You can also use 'di' from &lt;A href="http://www.gentoo.com/di/" target="_blank"&gt;http://www.gentoo.com/di/&lt;/A&gt;&lt;BR /&gt;Precompiled version available for HP-UX 11.00 and 10.20 on my ITRC site: &lt;A href="https://www.beepz.com/personal/merijn/#Downloads" target="_blank"&gt;https://www.beepz.com/personal/merijn/#Downloads&lt;/A&gt;&lt;BR /&gt;di has an option to spit out it's info in an easy to parse format.&lt;BR /&gt;Once used to di you never want to use df or dbf anymore</description>
    <pubDate>Thu, 05 Dec 2002 08:04:28 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2002-12-05T08:04:28Z</dc:date>
    <item>
      <title>who do I do a substr ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857995#M95374</link>
      <description>variableX can be tad4 or tad&lt;BR /&gt;&lt;BR /&gt;I always want the first 3 characters, so the result should always be "tad".&lt;BR /&gt;&lt;BR /&gt;How do I get the first 3 characters from variableX ?</description>
      <pubDate>Thu, 05 Dec 2002 01:01:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857995#M95374</guid>
      <dc:creator>Kamran Hussain</dc:creator>
      <dc:date>2002-12-05T01:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: who do I do a substr ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857996#M95375</link>
      <description>Hi Kamran,&lt;BR /&gt;&lt;BR /&gt;Try this&lt;BR /&gt;&lt;BR /&gt;echo $X | cut -c 1-3&lt;BR /&gt;&lt;BR /&gt;This will return the first three characters of the variable X.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Thu, 05 Dec 2002 01:05:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857996#M95375</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-12-05T01:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: who do I do a substr ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857997#M95376</link>
      <description>Thank you.&lt;BR /&gt;&lt;BR /&gt;I knew it was an easy one;  I was having the worst luck with awk:&lt;BR /&gt;&lt;BR /&gt;works here:&lt;BR /&gt;df -k /u100 | sed '1d' | awk '{print $5}' | awk '{printf "%02d\n", $1}'&lt;BR /&gt;&lt;BR /&gt;but not here !:&lt;BR /&gt;(given: x=tad4)&lt;BR /&gt;echo $X | awk '{printf "%03d\n", $1}'&lt;BR /&gt;&lt;BR /&gt;Can you shed some light on the above 2 -thanks.</description>
      <pubDate>Thu, 05 Dec 2002 01:41:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857997#M95376</guid>
      <dc:creator>Kamran Hussain</dc:creator>
      <dc:date>2002-12-05T01:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: who do I do a substr ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857998#M95377</link>
      <description>with awk you should be using the %s as the conversion type in the printf statement, printf("%3s\n",$1); or using substr, printf("%s\n",substr($0,1,3);&lt;BR /&gt;&lt;BR /&gt;or you could use sed, sed 's/\(...\).*/\1/'</description>
      <pubDate>Thu, 05 Dec 2002 03:47:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857998#M95377</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2002-12-05T03:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: who do I do a substr ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857999#M95378</link>
      <description>You can also use 'di' from &lt;A href="http://www.gentoo.com/di/" target="_blank"&gt;http://www.gentoo.com/di/&lt;/A&gt;&lt;BR /&gt;Precompiled version available for HP-UX 11.00 and 10.20 on my ITRC site: &lt;A href="https://www.beepz.com/personal/merijn/#Downloads" target="_blank"&gt;https://www.beepz.com/personal/merijn/#Downloads&lt;/A&gt;&lt;BR /&gt;di has an option to spit out it's info in an easy to parse format.&lt;BR /&gt;Once used to di you never want to use df or dbf anymore</description>
      <pubDate>Thu, 05 Dec 2002 08:04:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2857999#M95378</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-12-05T08:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: who do I do a substr ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2858000#M95379</link>
      <description>If you have a variable length string, you can also use the % operator to remove a substring from the right end of a string.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;a="tadf"&lt;BR /&gt;&amp;gt;b="${a%?}"&lt;BR /&gt;&amp;gt;print $a&lt;BR /&gt;tadf&lt;BR /&gt;&amp;gt;print $b&lt;BR /&gt;tad&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Scott Williams</description>
      <pubDate>Fri, 06 Dec 2002 14:50:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/who-do-i-do-a-substr/m-p/2858000#M95379</guid>
      <dc:creator>Scott Williams_5</dc:creator>
      <dc:date>2002-12-06T14:50:45Z</dc:date>
    </item>
  </channel>
</rss>

