<?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 cut command in admin script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867475#M397909</link>
    <description>I am using the cut command in a admin script to parse through a file with delimeter of ":". If I return one field from a file I just get the field itself. When I return two fields as in: cut -d : -f 1,2 I get the fields back as well as the delimeter seperating them. Is this expected - is there a way to get just the fields back?</description>
    <pubDate>Tue, 26 Oct 2004 11:36:14 GMT</pubDate>
    <dc:creator>Michael Murphy_2</dc:creator>
    <dc:date>2004-10-26T11:36:14Z</dc:date>
    <item>
      <title>cut command in admin script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867475#M397909</link>
      <description>I am using the cut command in a admin script to parse through a file with delimeter of ":". If I return one field from a file I just get the field itself. When I return two fields as in: cut -d : -f 1,2 I get the fields back as well as the delimeter seperating them. Is this expected - is there a way to get just the fields back?</description>
      <pubDate>Tue, 26 Oct 2004 11:36:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867475#M397909</guid>
      <dc:creator>Michael Murphy_2</dc:creator>
      <dc:date>2004-10-26T11:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: cut command in admin script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867476#M397910</link>
      <description>hi,&lt;BR /&gt; &lt;BR /&gt;this is normal behaviour.&lt;BR /&gt; &lt;BR /&gt;Workarounds?&lt;BR /&gt;- two separate cut commands?&lt;BR /&gt;- translate (tr) the delimeter in the result to something else?&lt;BR /&gt;- ...&lt;BR /&gt; &lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.</description>
      <pubDate>Tue, 26 Oct 2004 11:39:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867476#M397910</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2004-10-26T11:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: cut command in admin script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867477#M397911</link>
      <description>As told, this is normal behaviour. &lt;BR /&gt;Options -tr and awk.&lt;BR /&gt;&lt;BR /&gt;awk -F : '{print $1, $2}' input_file&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Tue, 26 Oct 2004 11:41:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867477#M397911</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-10-26T11:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: cut command in admin script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867478#M397912</link>
      <description>How about "awk"&lt;BR /&gt; &lt;BR /&gt;awk -F: 'print $1,$2' yourfile&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 26 Oct 2004 11:42:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867478#M397912</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-26T11:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: cut command in admin script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867479#M397913</link>
      <description>This is normal cut behavior. A better tool is awk:&lt;BR /&gt;&lt;BR /&gt;cat myfile | awk -F '.' '{ print $1,$2 }'&lt;BR /&gt;&lt;BR /&gt;should do just what you want; more over if you would like to read them into 2 shell variables in a loop that is easy as well.&lt;BR /&gt;&lt;BR /&gt; cat myfile | awk -F '.' '{ print $1,$2 }' | while read F1 F2&lt;BR /&gt;do&lt;BR /&gt;  echo "F1 = ${F1} F2 = ${F2}"&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Oct 2004 11:43:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867479#M397913</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-10-26T11:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: cut command in admin script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867480#M397914</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;use awk -F: '{print $1" "$2}' file&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Oct 2004 11:49:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867480#M397914</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2004-10-26T11:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: cut command in admin script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867481#M397915</link>
      <description>You need to use "\:" instead of just ":".  The command should work fine.</description>
      <pubDate>Tue, 26 Oct 2004 13:09:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867481#M397915</guid>
      <dc:creator>Stuart Whitby</dc:creator>
      <dc:date>2004-10-26T13:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: cut command in admin script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867482#M397916</link>
      <description>Thanks one and all...</description>
      <pubDate>Tue, 26 Oct 2004 13:50:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cut-command-in-admin-script/m-p/4867482#M397916</guid>
      <dc:creator>Michael Murphy_2</dc:creator>
      <dc:date>2004-10-26T13:50:10Z</dc:date>
    </item>
  </channel>
</rss>

