<?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 How can i show a variable value given in a string? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787873#M264414</link>
    <description>Hi .. &lt;BR /&gt;i'm using a function wich obtains a line with information to create a file which will be used by ftp command as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;main script has configured the following line:&lt;BR /&gt;interface_name=/home/user1&lt;BR /&gt;functons_path=/home/user1/FUNCTIONS&lt;BR /&gt;fpgp2=new_file.txt&lt;BR /&gt;&lt;BR /&gt;fun_sendinf_ftp $interface_name $functions_path $interface_log $fpgp2&lt;BR /&gt;DATOS=user=open#111.222.333.444=user#test#test=binary=prompt#off=mput#$fpgp2=dir#$fpgp2=bye&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#---&amp;gt; This is function file:&lt;BR /&gt;function fun_sendinf_ftp&lt;BR /&gt;{&lt;BR /&gt;for a in `echo $DATOS | sed 's/=/ /g'`&lt;BR /&gt;do&lt;BR /&gt;   if [[ $x &amp;gt; 1 ]]&lt;BR /&gt;   then&lt;BR /&gt;       echo $a |  sed 's/#/ /g' &amp;gt;&amp;gt; $logftp &lt;BR /&gt;   fi&lt;BR /&gt;   let "x = x + 1"&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;the $logftp  file contains:&lt;BR /&gt;open 111.222.333.444&lt;BR /&gt;user test test&lt;BR /&gt;binary&lt;BR /&gt;prompt off&lt;BR /&gt;mput $fpgp2&lt;BR /&gt;dir $fpgp2&lt;BR /&gt;bye&lt;BR /&gt;&lt;BR /&gt;My doubt here is:&lt;BR /&gt;how must i do to see the value of $fpgp2 into $logftp file?&lt;BR /&gt;I'm running:&lt;BR /&gt; echo $a |  sed 's/#/ /g' &amp;gt;&amp;gt; $logftp &lt;BR /&gt;&lt;BR /&gt;i thought that with echo command would show the value of the variable $fpgp2 but NOT !!!&lt;BR /&gt;it appears as string but that is a value and that value is given when is invoking the function:&lt;BR /&gt;fun_sendinf_ftp $interface_name $functions_path $interface_log $fpgp2&lt;BR /&gt;&lt;BR /&gt;How can i see the value?&lt;BR /&gt;I think it must run an exec command or something like that &lt;BR /&gt;&lt;BR /&gt;please help!!!&lt;BR /&gt;&lt;BR /&gt;Thanks !!&lt;BR /&gt;Manuales.</description>
    <pubDate>Sun, 14 May 2006 22:36:17 GMT</pubDate>
    <dc:creator>Manuales</dc:creator>
    <dc:date>2006-05-14T22:36:17Z</dc:date>
    <item>
      <title>How can i show a variable value given in a string?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787873#M264414</link>
      <description>Hi .. &lt;BR /&gt;i'm using a function wich obtains a line with information to create a file which will be used by ftp command as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;main script has configured the following line:&lt;BR /&gt;interface_name=/home/user1&lt;BR /&gt;functons_path=/home/user1/FUNCTIONS&lt;BR /&gt;fpgp2=new_file.txt&lt;BR /&gt;&lt;BR /&gt;fun_sendinf_ftp $interface_name $functions_path $interface_log $fpgp2&lt;BR /&gt;DATOS=user=open#111.222.333.444=user#test#test=binary=prompt#off=mput#$fpgp2=dir#$fpgp2=bye&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#---&amp;gt; This is function file:&lt;BR /&gt;function fun_sendinf_ftp&lt;BR /&gt;{&lt;BR /&gt;for a in `echo $DATOS | sed 's/=/ /g'`&lt;BR /&gt;do&lt;BR /&gt;   if [[ $x &amp;gt; 1 ]]&lt;BR /&gt;   then&lt;BR /&gt;       echo $a |  sed 's/#/ /g' &amp;gt;&amp;gt; $logftp &lt;BR /&gt;   fi&lt;BR /&gt;   let "x = x + 1"&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;the $logftp  file contains:&lt;BR /&gt;open 111.222.333.444&lt;BR /&gt;user test test&lt;BR /&gt;binary&lt;BR /&gt;prompt off&lt;BR /&gt;mput $fpgp2&lt;BR /&gt;dir $fpgp2&lt;BR /&gt;bye&lt;BR /&gt;&lt;BR /&gt;My doubt here is:&lt;BR /&gt;how must i do to see the value of $fpgp2 into $logftp file?&lt;BR /&gt;I'm running:&lt;BR /&gt; echo $a |  sed 's/#/ /g' &amp;gt;&amp;gt; $logftp &lt;BR /&gt;&lt;BR /&gt;i thought that with echo command would show the value of the variable $fpgp2 but NOT !!!&lt;BR /&gt;it appears as string but that is a value and that value is given when is invoking the function:&lt;BR /&gt;fun_sendinf_ftp $interface_name $functions_path $interface_log $fpgp2&lt;BR /&gt;&lt;BR /&gt;How can i see the value?&lt;BR /&gt;I think it must run an exec command or something like that &lt;BR /&gt;&lt;BR /&gt;please help!!!&lt;BR /&gt;&lt;BR /&gt;Thanks !!&lt;BR /&gt;Manuales.</description>
      <pubDate>Sun, 14 May 2006 22:36:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787873#M264414</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2006-05-14T22:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can i show a variable value given in a string?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787874#M264415</link>
      <description>Hi Manuales,&lt;BR /&gt;&lt;BR /&gt;what shell r u using??&lt;BR /&gt;&lt;BR /&gt;I have a test on your script, it work!!&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;fpgp2=hehe&lt;BR /&gt;&lt;BR /&gt;DATOS="open#111.222.333.444=user#test#test=binary=prompt#off=mput#$fpgp2=dir#$fpgp2=bye"&lt;BR /&gt;&lt;BR /&gt;function fun_sendinf_ftp&lt;BR /&gt;{&lt;BR /&gt;x=1&lt;BR /&gt;for a in `echo $1 | sed 's/=/ /g'`&lt;BR /&gt;do&lt;BR /&gt;if [[ $x &amp;gt; 0 ]]&lt;BR /&gt;then&lt;BR /&gt;echo $a | sed 's/#/ /g'&lt;BR /&gt;fi&lt;BR /&gt;let "x = x + 1"&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;fun_sendinf_ftp $DATOS&lt;BR /&gt;&lt;BR /&gt;OUTPUT:&lt;BR /&gt;open 111.222.333.444&lt;BR /&gt;user test test&lt;BR /&gt;binary&lt;BR /&gt;prompt off&lt;BR /&gt;mput hehe&lt;BR /&gt;dir hehe&lt;BR /&gt;bye&lt;BR /&gt;&lt;BR /&gt;GOOD LUCK!!</description>
      <pubDate>Sun, 14 May 2006 23:31:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787874#M264415</guid>
      <dc:creator>Warren_9</dc:creator>
      <dc:date>2006-05-14T23:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can i show a variable value given in a string?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787875#M264416</link>
      <description>I'm using ksh ....&lt;BR /&gt;DO NOT WORK!!!&lt;BR /&gt;&lt;BR /&gt;:'(</description>
      <pubDate>Mon, 15 May 2006 00:07:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787875#M264416</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2006-05-15T00:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can i show a variable value given in a string?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787876#M264417</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;did you try to put a " " on the DATOS= ??&lt;BR /&gt;and using ${fpgp2} to call the variable?&lt;BR /&gt;&lt;BR /&gt;BTW, the script also work in ksh.&lt;BR /&gt;&lt;BR /&gt;GOOD LUCK!</description>
      <pubDate>Mon, 15 May 2006 00:24:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787876#M264417</guid>
      <dc:creator>Warren_9</dc:creator>
      <dc:date>2006-05-15T00:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can i show a variable value given in a string?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787877#M264418</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I can't see, where youre variable x is preset,&lt;BR /&gt; try&lt;BR /&gt;function fun_sendinf_ftp&lt;BR /&gt;{&lt;BR /&gt;typeset -i x=0&lt;BR /&gt;for a in ...&lt;BR /&gt;...&lt;BR /&gt;((x+=1))&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 15 May 2006 04:31:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-show-a-variable-value-given-in-a-string/m-p/3787877#M264418</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-05-15T04:31:28Z</dc:date>
    </item>
  </channel>
</rss>

