<?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: simple (ish) script, seperate and reparse input string in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646133#M879352</link>
    <description>Bill,&lt;BR /&gt;&lt;BR /&gt;Shouldn't be the length of 012345678 be 9??&lt;BR /&gt;&lt;BR /&gt;awk '&lt;BR /&gt;{&lt;BR /&gt;stmp=""&lt;BR /&gt;tmp=$1&lt;BR /&gt;olenoftmp=length(tmp)&lt;BR /&gt; if ( ( olenoftmp % 2 ) != 0 ) {tmp = 0 tmp}&lt;BR /&gt;lenoftmp=length(tmp) / 2&lt;BR /&gt;for (i = 1; i &amp;lt; lenoftmp+1 ; i++) {&lt;BR /&gt;stmp = stmp "\x" substr(tmp,(i*2),1) substr(tmp,(i*2)-1,1)&lt;BR /&gt;}&lt;BR /&gt;stmp = stmp "\x" "FF," olenoftmp&lt;BR /&gt;printf "len of %s is %d\n",stmp,length(stmp)&lt;BR /&gt;}'&lt;BR /&gt;&lt;BR /&gt;Don't try changing the "\x" "FF" to "\xFF", other wise awk will make if an FF.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
    <pubDate>Wed, 16 Jan 2002 13:00:15 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2002-01-16T13:00:15Z</dc:date>
    <item>
      <title>simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646130#M879349</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm calling a script as follows:&lt;BR /&gt;&lt;BR /&gt;script 012345678&lt;BR /&gt;&lt;BR /&gt;and I need to take the 012345678&lt;BR /&gt;and make it look like this:&lt;BR /&gt;in a variable in the script:&lt;BR /&gt;&lt;BR /&gt;"\x00\x21\x43\x65\x87\xFF", 8&lt;BR /&gt;&lt;BR /&gt;where the last 8 is the number of digits input&lt;BR /&gt;&lt;BR /&gt;shold work if the number input is:  0123456789 as:&lt;BR /&gt;"\x10\x32\x54\x76\x98\xFF", 9&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;Later,&lt;BR /&gt;Bill</description>
      <pubDate>Wed, 16 Jan 2002 12:00:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646130#M879349</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2002-01-16T12:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646131#M879350</link>
      <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;echo $1 | awk '{n=$0;l=length($0)&lt;BR /&gt; if (l%2 == 1) {n=0.$0}&lt;BR /&gt; printf("\"")&lt;BR /&gt; for (i=1;i&amp;lt;=l;i=i+2)&lt;BR /&gt; {&lt;BR /&gt;  s1=substr(n,i,1)&lt;BR /&gt;  s2=substr(n,i+1,1)&lt;BR /&gt;  printf ("\x%s%s",s2,s1)&lt;BR /&gt; }&lt;BR /&gt; printf("\xFF\", %d\n",l-1)&lt;BR /&gt;}'&lt;BR /&gt;&lt;BR /&gt;The number of digits is 1 less than the *actual* number entered, by the looks of it, i.e. 0123456789 is 10 digits, not 9.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Wed, 16 Jan 2002 12:25:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646131#M879350</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-01-16T12:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646132#M879351</link>
      <description>Wow great!&lt;BR /&gt;yea it shouldn't be the l-1, that was my error..&lt;BR /&gt;&lt;BR /&gt;"\x10\x32\x54\x76\x98??", 9&lt;BR /&gt;&lt;BR /&gt;However, I'm getting a strange character appearing just before the closing "&lt;BR /&gt;&lt;BR /&gt;Finally for the 10,&lt;BR /&gt;it prints out fine to screen, but how can I set it to a shell variable to work further on it (for a sed)&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bill</description>
      <pubDate>Wed, 16 Jan 2002 12:53:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646132#M879351</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2002-01-16T12:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646133#M879352</link>
      <description>Bill,&lt;BR /&gt;&lt;BR /&gt;Shouldn't be the length of 012345678 be 9??&lt;BR /&gt;&lt;BR /&gt;awk '&lt;BR /&gt;{&lt;BR /&gt;stmp=""&lt;BR /&gt;tmp=$1&lt;BR /&gt;olenoftmp=length(tmp)&lt;BR /&gt; if ( ( olenoftmp % 2 ) != 0 ) {tmp = 0 tmp}&lt;BR /&gt;lenoftmp=length(tmp) / 2&lt;BR /&gt;for (i = 1; i &amp;lt; lenoftmp+1 ; i++) {&lt;BR /&gt;stmp = stmp "\x" substr(tmp,(i*2),1) substr(tmp,(i*2)-1,1)&lt;BR /&gt;}&lt;BR /&gt;stmp = stmp "\x" "FF," olenoftmp&lt;BR /&gt;printf "len of %s is %d\n",stmp,length(stmp)&lt;BR /&gt;}'&lt;BR /&gt;&lt;BR /&gt;Don't try changing the "\x" "FF" to "\xFF", other wise awk will make if an FF.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Jan 2002 13:00:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646133#M879352</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-01-16T13:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646134#M879353</link>
      <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;a=`script 012345678`&lt;BR /&gt;&lt;BR /&gt;should do it.  I don't get any funny characters when I run it.&lt;BR /&gt;&lt;BR /&gt;Can you pipe the output through | od -c and see what they are.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Wed, 16 Jan 2002 13:01:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646134#M879353</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-01-16T13:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646135#M879354</link>
      <description>read hello&lt;BR /&gt;hithere=`echo $hello |&lt;BR /&gt;awk '&lt;BR /&gt;{&lt;BR /&gt;stmp=""&lt;BR /&gt;tmp=$1&lt;BR /&gt;olenoftmp=length(tmp)&lt;BR /&gt; if ( ( olenoftmp % 2 ) != 0 ) {tmp = 0 tmp}&lt;BR /&gt;lenoftmp=length(tmp) / 2&lt;BR /&gt;for (i = 1; i &amp;lt; lenoftmp+1 ; i++) {&lt;BR /&gt;stmp = stmp "\x" substr(tmp,(i*2),1) substr(tmp,(i*2)-1,1)&lt;BR /&gt;}&lt;BR /&gt;stmp = stmp "\x" "FF," olenoftmp&lt;BR /&gt;printf stmp&lt;BR /&gt;}&lt;BR /&gt;'`&lt;BR /&gt;echo $hithere</description>
      <pubDate>Wed, 16 Jan 2002 13:04:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646135#M879354</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-01-16T13:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646136#M879355</link>
      <description>Bill,&lt;BR /&gt;&lt;BR /&gt;the funny character, probably a "y" with a sideways ":" over it is caused by awk interpeting the "\xFF" as a hex FF, that's why I had to seperate the "\x" and the "FF" into two seperate strings.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 16 Jan 2002 13:22:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646136#M879355</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-01-16T13:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646137#M879356</link>
      <description>yea that's what I was seeing Harry..</description>
      <pubDate>Wed, 16 Jan 2002 13:24:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646137#M879356</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2002-01-16T13:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: simple (ish) script, seperate and reparse input string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646138#M879357</link>
      <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;I was running an old version of awk - the later version was exhibiting your strange chars.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Wed, 16 Jan 2002 13:33:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-ish-script-seperate-and-reparse-input-string/m-p/2646138#M879357</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-01-16T13:33:34Z</dc:date>
    </item>
  </channel>
</rss>

