<?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 help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086561#M900042</link>
    <description>My solution:&lt;BR /&gt;&lt;BR /&gt;perl -pi -e 's/(\w{8,})\s(IN)\s(A)\s(.*)/$1\t$2\t$3\t$4/;s/(\w*(?!\t))\s(IN)\s(A)\s(.*)/$1\t\t$2\t$3\t$4/' file&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sergejs</description>
    <pubDate>Tue, 07 Oct 2003 10:28:19 GMT</pubDate>
    <dc:creator>Sergejs Svitnevs</dc:creator>
    <dc:date>2003-10-07T10:28:19Z</dc:date>
    <item>
      <title>script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086553#M900034</link>
      <description>hello..&lt;BR /&gt;&lt;BR /&gt;I've been getting good tips from you&lt;BR /&gt;thank you&lt;BR /&gt;&lt;BR /&gt;so I post a message..like script problem&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;gaul                IN  A   211.230.50.34&lt;BR /&gt;buksan             IN  A   211.230.50.34&lt;BR /&gt;sangwhang            IN  A   211.230.50.34&lt;BR /&gt;younhz          IN  A   211.230.50.34&lt;BR /&gt;kixx      IN  A   211.230.50.34&lt;BR /&gt;pooh4001        IN  A   211.230.50.34&lt;BR /&gt;pdy1260            IN  A   211.230.50.34&lt;BR /&gt;edonlee            IN  A   211.230.50.34&lt;BR /&gt;pun255840    IN  A   211.230.50.34&lt;BR /&gt;buwon2702       IN  A   211.230.50.34&lt;BR /&gt;leeys56         IN  A   211.230.50.34&lt;BR /&gt;hyi2900         IN  A   211.230.50.34&lt;BR /&gt;gemhee      IN  A   211.230.50.34&lt;BR /&gt;jso9782         IN  A   211.230.50.34&lt;BR /&gt;arc1370               IN  A   211.230.50.34&lt;BR /&gt;dong1637        IN  A   211.230.50.34&lt;BR /&gt;eelchoi         IN  A   211.230.50.34&lt;BR /&gt;junlee        IN  A   211.230.50.34&lt;BR /&gt;jdoryong   IN  A   211.230.50.34&lt;BR /&gt;cjfgh61         IN  A   211.230.50.34&lt;BR /&gt;sansarang       IN  A   211.230.50.34&lt;BR /&gt;hoamshin        IN  A   211.230.50.34&lt;BR /&gt;kcmkjk          IN  A   211.230.50.34&lt;BR /&gt;bhsong52                IN  A   211.230.50.34&lt;BR /&gt;bamgol          IN  A   211.230.50.34&lt;BR /&gt;lsk2104         IN  A   211.230.50.34&lt;BR /&gt;sasum4388       IN  A   211.230.50.34&lt;BR /&gt;kjs3896   IN  A   211.230.50.34&lt;BR /&gt;hannul          IN  A   211.230.50.34&lt;BR /&gt;rnwhdah70       IN  A   211.230.50.34&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;omitted..&lt;BR /&gt;&lt;BR /&gt;As you see lines 'IN  A  211.230.50.34' is&lt;BR /&gt;not aligned&lt;BR /&gt;&lt;BR /&gt;so I have been editting it by vi and up and&lt;BR /&gt;down keyboard, press tabs or space keys to make them align&lt;BR /&gt;&lt;BR /&gt;it is boring and waste too much time.&lt;BR /&gt;totals are over 200 lines.&lt;BR /&gt;How can I use script to reduce time like doing&lt;BR /&gt;jobs.&lt;BR /&gt;&lt;BR /&gt;Any tips will be helpful&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Oct 2003 21:20:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086553#M900034</guid>
      <dc:creator>jackfiled</dc:creator>
      <dc:date>2003-10-06T21:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086554#M900035</link>
      <description>This is easy using typeset to define the size of each field:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;PATH=/usr/bin&lt;BR /&gt;set -u&lt;BR /&gt;typeset -L10 MYNAME&lt;BR /&gt;typeset -L2 IN&lt;BR /&gt;typeset -L1 A&lt;BR /&gt;typeset -L15 IPADDR&lt;BR /&gt;cat | while read MYNAME IN A IPADDR&lt;BR /&gt;do&lt;BR /&gt;print "$MYNAME $IN $A $IPADDR"&lt;BR /&gt;done&lt;BR /&gt; &lt;BR /&gt;To use the script:&lt;BR /&gt; &lt;BR /&gt;cat unformatted_file | this_script</description>
      <pubDate>Mon, 06 Oct 2003 21:34:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086554#M900035</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-10-06T21:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086555#M900036</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Off my head, here's a not-so-clean approach:&lt;BR /&gt; &lt;BR /&gt;# cat $file | awk '{print $1"\t"$2"\t"$3"\t"$4}'&lt;BR /&gt; &lt;BR /&gt;However, you need to set your tab size to a size that exceeds the length of your first name field so that all tabs get aligned.&lt;BR /&gt; &lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt; &lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Mon, 06 Oct 2003 22:28:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086555#M900036</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2003-10-06T22:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086556#M900037</link>
      <description>how to set my tabsize?&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Oct 2003 00:51:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086556#M900037</guid>
      <dc:creator>jackfiled</dc:creator>
      <dc:date>2003-10-07T00:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086557#M900038</link>
      <description>setting the tabsize is a function of the terminal you are using to view it.  Some terminals allow you set the tab size with escape sequences defined in /etc/termcap or the /etc/terminfo database BUT most don't.  I wouldn't use tabs if you really want to make sure it all lines up always.</description>
      <pubDate>Tue, 07 Oct 2003 00:57:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086557#M900038</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-10-07T00:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086558#M900039</link>
      <description>I am attaching a small perl thing tou format this all nicely for you. I'll post it here too but the lack of a &lt;PRE&gt; tag will play havoc with the formatting!&lt;BR /&gt;&lt;BR /&gt;You need to pipe your data into this script.&lt;BR /&gt;  &lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt; &lt;BR /&gt;format =&lt;BR /&gt;@&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;  @&amp;lt;&amp;lt;  @&amp;lt;       @&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;$text,                $ch, $letter, $IP&lt;BR /&gt;.&lt;BR /&gt; &lt;BR /&gt;while(&amp;lt;&amp;gt;){&lt;BR /&gt;        ($text,$ch,$letter,$IP)=split " ",$_;&lt;BR /&gt;        write;&lt;BR /&gt;}&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Oct 2003 01:21:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086558#M900039</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-10-07T01:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086559#M900040</link>
      <description>In my script example above, you can change the typeset values to define the width of each field, or leave them as is, and change the print statement to include more spaces as needed. The tab character is only useful for terminals and programs that understand tab as a field separator or white space. To align the DNS data above, just count the spaces and adjust the print statement. Here in the forums, the text optimizer removes blank lines, leading spaces and multiple spaces are truncated to one space. So to illustrate multiple spaces, I'll use the _ underscore character:&lt;BR /&gt; &lt;BR /&gt;print "$MYNAME___$IN___$A________$IPADDR"</description>
      <pubDate>Tue, 07 Oct 2003 07:24:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086559#M900040</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-10-07T07:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086560#M900041</link>
      <description>Hi,&lt;BR /&gt;An alternative to typeset is to use printf&lt;BR /&gt;while read a b c d&lt;BR /&gt;do&lt;BR /&gt;printf "%10s, %2s, %1s, %15s\n" $a $b $c $d&lt;BR /&gt;done</description>
      <pubDate>Tue, 07 Oct 2003 07:40:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086560#M900041</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2003-10-07T07:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086561#M900042</link>
      <description>My solution:&lt;BR /&gt;&lt;BR /&gt;perl -pi -e 's/(\w{8,})\s(IN)\s(A)\s(.*)/$1\t$2\t$3\t$4/;s/(\w*(?!\t))\s(IN)\s(A)\s(.*)/$1\t\t$2\t$3\t$4/' file&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sergejs</description>
      <pubDate>Tue, 07 Oct 2003 10:28:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086561#M900042</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2003-10-07T10:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086562#M900043</link>
      <description>another awk script&lt;BR /&gt;&lt;BR /&gt;awk '{printf("%s %2s %1s %15s\n",substr($1"         ",1,10),$2,$3,$4);}' &lt;YOURFILE&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jean-Luc&lt;/YOURFILE&gt;</description>
      <pubDate>Tue, 07 Oct 2003 10:55:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086562#M900043</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-10-07T10:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086563#M900044</link>
      <description>Please note spaces have disappeared !&lt;BR /&gt;in substr($1" " ... 9 spaces.&lt;BR /&gt;Another strange behaviour here !&lt;BR /&gt;&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Tue, 07 Oct 2003 10:56:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086563#M900044</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-10-07T10:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086564#M900045</link>
      <description>One liner script like this will do the trick:&lt;BR /&gt;cat dnsfile | awk '{print $1,"/t",$2,"/t",$3,"/t",$4}' &amp;gt;newdnsfile&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;king of the one liners...</description>
      <pubDate>Fri, 19 Dec 2003 12:21:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3086564#M900045</guid>
      <dc:creator>Michael Morgan_5</dc:creator>
      <dc:date>2003-12-19T12:21:52Z</dc:date>
    </item>
  </channel>
</rss>

