<?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: Script Output in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532508#M678554</link>
    <description>&lt;!--!*#--&gt;You have spaces after each ","?&lt;BR /&gt;for word in $(sed 's/,//g' file); do&lt;BR /&gt;   print $word&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;With vi you can change comma to newlines:&lt;BR /&gt;:%s/, /^V/g&lt;BR /&gt;(That's a control-V.)&lt;BR /&gt;Then a cleanup of comma without a space.&lt;BR /&gt;</description>
    <pubDate>Thu, 12 Nov 2009 13:34:20 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2009-11-12T13:34:20Z</dc:date>
    <item>
      <title>Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532502#M678548</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;Can you help below Please? Using sed command, How to convert the input as "adhn4807, adhn5326, adhn5327, adhn5328, adhn5333," to the output below?&lt;BR /&gt;&lt;BR /&gt;adhn4807&lt;BR /&gt;adhn5326&lt;BR /&gt;adhn5327&lt;BR /&gt;adhn5328&lt;BR /&gt;adhn5333&lt;BR /&gt;&lt;BR /&gt;Thanks alot in advance. &lt;BR /&gt;Regards,&lt;BR /&gt;Negara&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Nov 2009 09:41:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532502#M678548</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2009-11-12T09:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532503#M678549</link>
      <description>&lt;!--!*#--&gt;Hi Dewa,&lt;BR /&gt;&lt;BR /&gt;I am not sure about sed, but following script runs well according to you:&lt;BR /&gt;&lt;BR /&gt;#################&lt;BR /&gt;#!/usr/bin/sh &lt;BR /&gt;VAR="adhn4807, adhn5326, adhn5327, adhn5328, adhn5333,"&lt;BR /&gt;for A in `echo $VAR | awk -F"," '{print $1,$2,$3,$4,$5}'`&lt;BR /&gt;do&lt;BR /&gt;echo $A&lt;BR /&gt;done&lt;BR /&gt;#################&lt;BR /&gt;&lt;BR /&gt;Hope this helps..&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Nov 2009 10:28:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532503#M678549</guid>
      <dc:creator>R.K. #</dc:creator>
      <dc:date>2009-11-12T10:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532504#M678550</link>
      <description>Thanks alot. But here there are so many servers in the list...adhn4807, adhn5326, adhn5327, adhn5328, adhn5333,...,....,.....,etc (many more)&lt;BR /&gt;&lt;BR /&gt;Need to convert the output to:&lt;BR /&gt;adhn4807&lt;BR /&gt;adhn5326&lt;BR /&gt;adhn5327&lt;BR /&gt;adhn5328&lt;BR /&gt;adhn5333&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;etc (many more)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Negara</description>
      <pubDate>Thu, 12 Nov 2009 10:44:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532504#M678550</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2009-11-12T10:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532505#M678551</link>
      <description>&lt;!--!*#--&gt;Hi Again,&lt;BR /&gt;&lt;BR /&gt;You can put the server names in a file "ex1".&lt;BR /&gt;Then run following command:&lt;BR /&gt;&lt;BR /&gt;# awk -F", " '{ for (i = 1; i &amp;lt;= NF; i++) print $i}' ex1&lt;BR /&gt;&lt;BR /&gt;adhn4807&lt;BR /&gt;adhn5326&lt;BR /&gt;adhn5327&lt;BR /&gt;adhn5328&lt;BR /&gt;adhn5333&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Where:&lt;BR /&gt;#more ex1&lt;BR /&gt;adhn4807, adhn5326, adhn5327, adhn5328, adhn5333&lt;BR /&gt;&lt;BR /&gt;Hope this will be of some help..&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Nov 2009 11:17:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532505#M678551</guid>
      <dc:creator>R.K. #</dc:creator>
      <dc:date>2009-11-12T11:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532506#M678552</link>
      <description>if this is in a file :&lt;BR /&gt;&lt;BR /&gt;cat &lt;FILE input=""&gt; | tr "\," "\n" &lt;BR /&gt;or&lt;BR /&gt;tr "\," "\n"  &amp;lt; &lt;FILE input=""&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc&lt;/FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Thu, 12 Nov 2009 11:30:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532506#M678552</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2009-11-12T11:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532507#M678553</link>
      <description>Hi Dewa:&lt;BR /&gt;&lt;BR /&gt;Your data shows that there are whitespaces following the commas.  To eliminate these and produce the output you showed, use a one-process Perl instead of pipes with 'tr' and/or 'sed':&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/,\s*/\n/g' file&lt;BR /&gt;&lt;BR /&gt;(or)&lt;BR /&gt;&lt;BR /&gt;# X="adhn4807, adhn5326, adhn5327, adhn5328, adhn5333"&lt;BR /&gt;# echo ${X}|perl -pe 's/,\s*/\n/g'&lt;BR /&gt;&lt;BR /&gt;This code reads your file globally substituting a newline character for any comma with or without an optional whitespace (\s) following it.&lt;BR /&gt;&lt;BR /&gt;If you are using a GNU 'sed' then this would work too:&lt;BR /&gt;&lt;BR /&gt;# sed -e "s/,[ ]*/\n"/g file&lt;BR /&gt;&lt;BR /&gt;Unfortunately, the standard HP-UX 'sed' doesn't support this syntax.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Nov 2009 13:18:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532507#M678553</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-11-12T13:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532508#M678554</link>
      <description>&lt;!--!*#--&gt;You have spaces after each ","?&lt;BR /&gt;for word in $(sed 's/,//g' file); do&lt;BR /&gt;   print $word&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;With vi you can change comma to newlines:&lt;BR /&gt;:%s/, /^V/g&lt;BR /&gt;(That's a control-V.)&lt;BR /&gt;Then a cleanup of comma without a space.&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Nov 2009 13:34:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532508#M678554</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-12T13:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532509#M678555</link>
      <description>Oops:&lt;BR /&gt;With vi you can change comma to newlines:&lt;BR /&gt;:%s/, /^V^M/g&lt;BR /&gt;(That's a control-V followed by a enter.)&lt;BR /&gt;Then a cleanup of comma without a space.</description>
      <pubDate>Thu, 12 Nov 2009 13:36:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532509#M678555</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-12T13:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script Output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532510#M678556</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;Thanks alot for your help. Got the answer. Appreciate your help. &lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Negara</description>
      <pubDate>Thu, 12 Nov 2009 16:31:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-output/m-p/4532510#M678556</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2009-11-12T16:31:24Z</dc:date>
    </item>
  </channel>
</rss>

