<?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: print field seperators in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170015#M665772</link>
    <description>I thought I'd have a play and came up with:&lt;BR /&gt;&lt;BR /&gt;echo ${ECM_PORT[*]} |awk '{ for ( i = 1; i &amp;lt;= NF; i = i  + 1 )&lt;BR /&gt;if ( i == 1 ) out = $i&lt;BR /&gt;else out = out"+"$i&lt;BR /&gt;print out}'&lt;BR /&gt;443+7943+7843+7080+7090&lt;BR /&gt;&lt;BR /&gt;Thanks again &lt;BR /&gt;&lt;BR /&gt;Chris</description>
    <pubDate>Thu, 16 Apr 2009 14:54:12 GMT</pubDate>
    <dc:creator>lawrenzo_1</dc:creator>
    <dc:date>2009-04-16T14:54:12Z</dc:date>
    <item>
      <title>print field seperators</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170012#M665769</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I have setup an array in a config file and what to use it in two ways - here is the array:&lt;BR /&gt;&lt;BR /&gt;ECM_PORT[1]=443&lt;BR /&gt;ECM_PORT[2]=7943&lt;BR /&gt;ECM_PORT[3]=7843&lt;BR /&gt;ECM_PORT[4]=7080&lt;BR /&gt;ECM_PORT[5]=7090&lt;BR /&gt;&lt;BR /&gt;the first is to print the array on one line field seperator being a "+"&lt;BR /&gt;&lt;BR /&gt;# echo ${ECM_PORT[*]}&lt;BR /&gt;443 7943 7843 7080 7090&lt;BR /&gt;&lt;BR /&gt;so I want to replace the white space with:&lt;BR /&gt;&lt;BR /&gt;443+7943+7843+7080+7090&lt;BR /&gt;&lt;BR /&gt;the string is to be executed in a command and the array will contain a different number of elements depending on the environment being configured.&lt;BR /&gt;&lt;BR /&gt;The second function is pretty straight forward and can workout myself :-)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Thu, 16 Apr 2009 12:24:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170012#M665769</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-04-16T12:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: print field seperators</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170013#M665770</link>
      <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;You could use 'tr' as:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;set -A EMC_PORT&lt;BR /&gt;ECM_PORT[1]=443&lt;BR /&gt;ECM_PORT[2]=7943&lt;BR /&gt;ECM_PORT[3]=7843&lt;BR /&gt;ECM_PORT[4]=7080&lt;BR /&gt;ECM_PORT[5]=7090&lt;BR /&gt;echo "${ECM_PORT[*]}"|tr -s " " "+"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Apr 2009 12:34:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170013#M665770</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-16T12:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: print field seperators</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170014#M665771</link>
      <description>quite simple if I just took a step back :-)&lt;BR /&gt;&lt;BR /&gt;I was playing around with on something like:&lt;BR /&gt;&lt;BR /&gt;echo ${ECM_PORT[*]} |awk 'BEGIN{RS="\n";ORS="+"};{ for ( i = NF; i &amp;gt; 0; i = i  - 1 ) print $i}'&lt;BR /&gt;&lt;BR /&gt;which prints:&lt;BR /&gt;&lt;BR /&gt;7090+7080+7843+7943+443+&lt;BR /&gt;&lt;BR /&gt;this obviously prints backwards and leaves a "+" at the end with no carriage return.&lt;BR /&gt;&lt;BR /&gt;my way needs a bit more work to print in order.&lt;BR /&gt;&lt;BR /&gt;Thanks anyway james - your help is always appreciated.&lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Apr 2009 13:14:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170014#M665771</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-04-16T13:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: print field seperators</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170015#M665772</link>
      <description>I thought I'd have a play and came up with:&lt;BR /&gt;&lt;BR /&gt;echo ${ECM_PORT[*]} |awk '{ for ( i = 1; i &amp;lt;= NF; i = i  + 1 )&lt;BR /&gt;if ( i == 1 ) out = $i&lt;BR /&gt;else out = out"+"$i&lt;BR /&gt;print out}'&lt;BR /&gt;443+7943+7843+7080+7090&lt;BR /&gt;&lt;BR /&gt;Thanks again &lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Thu, 16 Apr 2009 14:54:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170015#M665772</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-04-16T14:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: print field seperators</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170016#M665773</link>
      <description>Hi (again) Chris:&lt;BR /&gt;&lt;BR /&gt;If you prefer your 'awk', then:&lt;BR /&gt;&lt;BR /&gt;# echo "${ECM_PORT[*]}"|awk '{for (i=1;i&lt;NF&gt;&lt;/NF&gt;&lt;BR /&gt;...or:&lt;BR /&gt;&lt;BR /&gt;# echo "${ECM_PORT[*]}"|awk '{for (i=1;i&lt;NF&gt;&lt;/NF&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 16 Apr 2009 15:23:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170016#M665773</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-16T15:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: print field seperators</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170017#M665774</link>
      <description>&amp;gt;the first is to print the array on one line field separator being a "+"&lt;BR /&gt;&lt;BR /&gt;Why is everyone working so hard? :-)&lt;BR /&gt;IFS_SAVE=$IFS&lt;BR /&gt;IFS="+"&lt;BR /&gt;echo ${ECM_PORT[*]}&lt;BR /&gt;IFS=$IFS_SAVE&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Apr 2009 04:10:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170017#M665774</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-04-17T04:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: print field seperators</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170018#M665775</link>
      <description>I get your point Dennis :-)&lt;BR /&gt;&lt;BR /&gt;thanks both and I'll be using the first solution as this is probably the most effecient and understandable but wanted to play around !&lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Fri, 17 Apr 2009 06:18:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/print-field-seperators/m-p/5170018#M665775</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-04-17T06:18:52Z</dc:date>
    </item>
  </channel>
</rss>

