<?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: eval command help... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328217#M642023</link>
    <description>assume the value of ID is f375e6da-b5e7-71a0-0235-031f8e1e0000&lt;BR /&gt;&lt;BR /&gt;now&lt;BR /&gt;hexvalue=cut -c26-32 $ID&lt;BR /&gt;&lt;BR /&gt;this returns "-c26-32 not found&lt;BR /&gt;&lt;BR /&gt;hexvalue=`cut -c26-32 $ID`&lt;BR /&gt;this returns&lt;BR /&gt;cut: Cannot open f375e6da-b5e7-71a0-0235-031f8e1e0000.&lt;BR /&gt;</description>
    <pubDate>Sun, 11 Sep 2011 14:43:05 GMT</pubDate>
    <dc:creator>sekar sundaram</dc:creator>
    <dc:date>2011-09-11T14:43:05Z</dc:date>
    <item>
      <title>eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328207#M642021</link>
      <description>&lt;P&gt;&lt;SPAN class="Apple-style-span"&gt;/opt/OV/bin/OpC/install/opc_ip_addr -help&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-style-span"&gt;Usage: opc_ip_addr [hostname] .. [hostname]&lt;BR /&gt;opc_ip_addr [ip] .. [ip]&lt;BR /&gt;opc_ip_addr -r [hexip] .. [hexip]&lt;BR /&gt;Convert an hostnames or an ip-adresses to a hex-ip-strings w/o dots&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-style-span"&gt;i want to convert a hexip to node name.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#111111"&gt;&lt;SPAN class="Apple-style-span"&gt;that is&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#111111"&gt;&lt;SPAN class="Apple-style-span"&gt;opc_ip_addr -r﻿ hexip&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i run straight forward:&lt;/P&gt;&lt;P&gt;sekar@OVO&amp;gt; /opt/OV/bin/OpC/install/opc_ip_addr -r &amp;lt;hexip&amp;gt;&lt;/P&gt;&lt;P&gt;node.name.com &amp;nbsp; &amp;nbsp;= 1.1.2.3 = &amp;lt;hexip&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but thru a script, i will have the hexip thru a variable.&lt;/P&gt;&lt;P&gt;inside the script, when i run&lt;/P&gt;&lt;P&gt;/opt/OV/bin/OpC/install/opc_ip_addr -r&amp;nbsp;﻿$HEXIP_VARIABLE&lt;BR /&gt;its not using the value of HEXIP_VARIABLE. it says "no hex_ip or &amp;nbsp;wrong format"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any clues?? you need more infromation??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 14:26:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328207#M642021</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2011-09-11T14:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328211#M642022</link>
      <description>i got it....the $HEX_VARIABLE has a carriage return(enter key)...&lt;BR /&gt;any idea how to remove the "enter key" ???</description>
      <pubDate>Sun, 11 Sep 2011 14:34:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328211#M642022</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2011-09-11T14:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328217#M642023</link>
      <description>assume the value of ID is f375e6da-b5e7-71a0-0235-031f8e1e0000&lt;BR /&gt;&lt;BR /&gt;now&lt;BR /&gt;hexvalue=cut -c26-32 $ID&lt;BR /&gt;&lt;BR /&gt;this returns "-c26-32 not found&lt;BR /&gt;&lt;BR /&gt;hexvalue=`cut -c26-32 $ID`&lt;BR /&gt;this returns&lt;BR /&gt;cut: Cannot open f375e6da-b5e7-71a0-0235-031f8e1e0000.&lt;BR /&gt;</description>
      <pubDate>Sun, 11 Sep 2011 14:43:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328217#M642023</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2011-09-11T14:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328223#M642024</link>
      <description>&lt;P&gt;&amp;gt;any idea how to remove the CR?﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You fix your data file so it doesn't end in CR/LF with dos2ux(1).&lt;/P&gt;&lt;P&gt;Or you would remove the last char of the variable:&lt;/P&gt;&lt;P&gt;HEX_VARIABLE﻿=${HEX_VARIABLE﻿%.}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or use echo and tr(1) to delete it.&lt;/P&gt;&lt;P&gt;Or use echo and cut(1) to remove it:&lt;/P&gt;&lt;P&gt;hexvalue=$(echo $ID | cut -c26-32)&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 14:52:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328223#M642024</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-11T14:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328229#M642025</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/608691"&gt;@sekar sundaram&lt;/a&gt; wrote:&lt;BR /&gt;i got it....the $HEX_VARIABLE has a carriage return(enter key)...&lt;BR /&gt;any idea how to remove the "enter key" ???&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You could do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HEX_VARIABLE=$(echo ${HEX_VARIABLE}|perl -pe 's/\r//g')&lt;/PRE&gt;&lt;P&gt;or even faster:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HEX_VARIABLE=$(echo ${HEX_VARIABLE}|tr -d "\015")&lt;/PRE&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 14:56:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328229#M642025</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-09-11T14:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328233#M642026</link>
      <description>&lt;P&gt;Cool....its good...&lt;/P&gt;&lt;P&gt;HEX_IP=$(echo $ID | cut -c26-32)﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;one more issue....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i run&amp;nbsp;&lt;/P&gt;&lt;P&gt;opc_ip_addr -r $HEX_IP&lt;/P&gt;&lt;P&gt;it runs good...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when i assign the value to NODE like this,&lt;/P&gt;&lt;P&gt;NODE=opc_ip_addr -r $HEX_IP&lt;/P&gt;&lt;P&gt;it gives:&lt;/P&gt;&lt;P&gt;./script.sh: -r: &amp;nbsp;not found&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any ideas???&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 15:01:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328233#M642026</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2011-09-11T15:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328235#M642027</link>
      <description>&lt;P&gt;&amp;gt;but when I assign the value to NODE like this: NODE=opc_ip_addr -r $HEX_IP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The correct form for command substitution is:&lt;/P&gt;&lt;P&gt;NODE=$(opc_ip_addr -r $HEX_IP﻿)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;./script.sh: -r:&amp;nbsp; not found﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your syntax did something like: (export NODE=opc_ip_addr; -r $HEX_IP﻿)&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 15:07:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328235#M642027</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-11T15:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328237#M642028</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/608691"&gt;@sekar sundaram&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Cool....its good...&lt;/P&gt;&lt;P&gt;HEX_IP=$(echo $ID | cut -c26-32)﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;one more issue....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i run&amp;nbsp;&lt;/P&gt;&lt;P&gt;opc_ip_addr -r $HEX_IP&lt;/P&gt;&lt;P&gt;it runs good...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when i assign the value to NODE like this,&lt;/P&gt;&lt;P&gt;NODE=opc_ip_addr -r $HEX_IP&lt;/P&gt;&lt;P&gt;it gives:&lt;/P&gt;&lt;P&gt;./script.sh: -r: &amp;nbsp;not found&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any ideas???&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course.&amp;nbsp; Do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NODE=$(opc_ip_addr -r $HEX_IP﻿)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, using 'cut' with columns means that this only works if your input string has exactly the format you want.&amp;nbsp; I'd use the 'tr' I suggested above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 15:06:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328237#M642028</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-09-11T15:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328241#M642029</link>
      <description>super cool....i got it 100%...&lt;BR /&gt;&lt;BR /&gt;between,&lt;BR /&gt;NODE=opc_ip_addr -r $HEX_IP&lt;BR /&gt;for this situation, cant we use eval command?</description>
      <pubDate>Sun, 11 Sep 2011 15:08:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328241#M642029</guid>
      <dc:creator>sekar sundaram</dc:creator>
      <dc:date>2011-09-11T15:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328247#M642030</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/608691"&gt;@sekar sundaram&lt;/a&gt; wrote:&lt;BR /&gt;super cool....i got it 100%...&lt;BR /&gt;&lt;BR /&gt;between,&lt;BR /&gt;NODE=opc_ip_addr -r $HEX_IP&lt;BR /&gt;for this situation, cant we use eval command?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Why?&amp;nbsp; The $(...) for is the modern replacement for the archaic backtick syntax.&amp;nbsp; This runs the command and assigns the output (if any) to the lvalue (variable).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An 'eval' is used in situations where you need the shell to scan input twice; once to interpolate variables and the second time to use them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 15:11:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328247#M642030</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-09-11T15:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: eval command help...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328249#M642031</link>
      <description>&lt;P&gt;&amp;gt;for this situation, can't we use eval command?﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why?&amp;nbsp; If you want to do command substitution, $() (or the archaic ``), do command substitution, not eval.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2011 15:13:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/eval-command-help/m-p/5328249#M642031</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-11T15:13:27Z</dc:date>
    </item>
  </channel>
</rss>

