<?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: Cut command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737189#M721902</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Also remember to add double-quotes (") for your VAR1 to VAR5 i.e.&lt;BR /&gt;&lt;BR /&gt;VAR1="..."&lt;BR /&gt;VAR2="..."&lt;BR /&gt;... and so forth&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
    <pubDate>Tue, 04 Jun 2002 14:04:59 GMT</pubDate>
    <dc:creator>Steven Sim Kok Leong</dc:creator>
    <dc:date>2002-06-04T14:04:59Z</dc:date>
    <item>
      <title>Cut command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737187#M721900</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I??m writting a script ( tra.sh ) to read an input file ( file.txt ) and creates an output ( output.txt ). The problem is that the cut command that I??m using at the VAR4 is giving me a strange value, like this:&lt;BR /&gt;RJ-05000-RIO and not all the contents. How to read all and set the correct value at VAR4 ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;R.Bassoi</description>
      <pubDate>Tue, 04 Jun 2002 13:53:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737187#M721900</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2002-06-04T13:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737188#M721901</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The fault likes with this:&lt;BR /&gt;&lt;BR /&gt;for VARS in $(cat file.txt)&lt;BR /&gt;&lt;BR /&gt;This is because spacingsl be used to delimit the VARS when you cat file.txt, apart from newlines.&lt;BR /&gt;&lt;BR /&gt;Do this instead:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;cat file.txt|while read a b c d e f g&lt;BR /&gt;do&lt;BR /&gt;  VARS="$a $b $c $d $e $f $g"&lt;BR /&gt;    VAR1=$(echo $VARS|cut -d";" -f1)&lt;BR /&gt;  VAR2=$(echo $VARS|cut -d";" -f2)&lt;BR /&gt;  VAR3=$(echo $VARS|cut -d";" -f3)&lt;BR /&gt;  VAR4=$(echo $VARS|cut -d";" -f4)&lt;BR /&gt;  VAR5=$(echo $VARS|cut -d";" -f5)&lt;BR /&gt;  echo "CRECENTR,AREADG=INTRA-RJ-2,CARRIER=031,F_MOV=0,LOC_RF=$VAR4,OPERA_RF=31-&lt;BR /&gt;TELEMAR,PREFINT=$VAR1,PREFURB=$VAR2$VAR3,TARIF_RF=0100;" &amp;gt;&amp;gt; output.txt&lt;BR /&gt;done&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jun 2002 14:01:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737188#M721901</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-06-04T14:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737189#M721902</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Also remember to add double-quotes (") for your VAR1 to VAR5 i.e.&lt;BR /&gt;&lt;BR /&gt;VAR1="..."&lt;BR /&gt;VAR2="..."&lt;BR /&gt;... and so forth&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Tue, 04 Jun 2002 14:04:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737189#M721902</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-06-04T14:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737190#M721903</link>
      <description>Hi Ricardo,&lt;BR /&gt;&lt;BR /&gt;This is because "for VARS in $(cat file.txt);do" is cutting by spaces try doing a sed before in order to substitute spaces by other character like "#":&lt;BR /&gt;sed 's/ /#/g' file.txt &amp;gt; file1.txt&lt;BR /&gt;for VARS in $(cat file1.txt);do&lt;BR /&gt;&lt;BR /&gt;An then into the for undo the changes with:&lt;BR /&gt;VARSok=`echo | sed 's/#/ /g'`&lt;BR /&gt;&lt;BR /&gt;An then use the new variable VARSok to cut.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
      <pubDate>Tue, 04 Jun 2002 14:07:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737190#M721903</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2002-06-04T14:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737191#M721904</link>
      <description>&lt;BR /&gt;Tks Steve,&lt;BR /&gt;&lt;BR /&gt;I forgot: Its possible to remove ( when is present ) the first 0 from the VAR1 ?&lt;BR /&gt;&lt;BR /&gt;Tks,</description>
      <pubDate>Tue, 04 Jun 2002 14:09:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737191#M721904</guid>
      <dc:creator>Ricardo Bassoi</dc:creator>
      <dc:date>2002-06-04T14:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737192#M721905</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Yes, since there is only one zero and it is always at the first position:&lt;BR /&gt;&lt;BR /&gt;echo $VAR1|cut -c2-&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Tue, 04 Jun 2002 14:12:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737192#M721905</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-06-04T14:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737193#M721906</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry, I misread your question. Do this:&lt;BR /&gt;&lt;BR /&gt;VAR1=`bc &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;$VAR1 + 0&lt;BR /&gt;EOF`&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Tue, 04 Jun 2002 14:15:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command/m-p/2737193#M721906</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-06-04T14:15:06Z</dc:date>
    </item>
  </channel>
</rss>

