<?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: Why does not work a sentece kept in a variable when is delivered in other script? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790807#M264966</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;when you do echo $2 |sed 's/_//g'&lt;BR /&gt;&lt;BR /&gt;it just removes the "_"&lt;BR /&gt;&lt;BR /&gt;So your command will fail,&lt;BR /&gt;&lt;BR /&gt;i think you need to do sed s/_/ /g&lt;BR /&gt;&lt;BR /&gt;Chan</description>
    <pubDate>Thu, 18 May 2006 13:11:55 GMT</pubDate>
    <dc:creator>Chan 007</dc:creator>
    <dc:date>2006-05-18T13:11:55Z</dc:date>
    <item>
      <title>Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790806#M264965</link>
      <description>Hi ..&lt;BR /&gt;i have a program which has the following  variable:&lt;BR /&gt;&lt;BR /&gt;VALOR="/usr/bin/ftp_-v_-n_-i_&amp;lt;_$logftp_&amp;gt;_${logftp}_out"&lt;BR /&gt;&lt;BR /&gt;then, this value is sent to other script named script2:&lt;BR /&gt;&lt;BR /&gt;script2 $VALOR&lt;BR /&gt;&lt;BR /&gt;script2 contains many things between them:&lt;BR /&gt;....&lt;BR /&gt;...&lt;BR /&gt;echo $2 | sed 's/_/ /g'&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt; &lt;BR /&gt;it guess $2 is an instruction apart of be a command ... but it does not work as command !!!&lt;BR /&gt;&lt;BR /&gt;it does not make the ftp indicated in that variable ... why?&lt;BR /&gt;&lt;BR /&gt;can you help me??&lt;BR /&gt;&lt;BR /&gt;Thanks ...</description>
      <pubDate>Thu, 18 May 2006 13:07:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790806#M264965</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2006-05-18T13:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790807#M264966</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;when you do echo $2 |sed 's/_//g'&lt;BR /&gt;&lt;BR /&gt;it just removes the "_"&lt;BR /&gt;&lt;BR /&gt;So your command will fail,&lt;BR /&gt;&lt;BR /&gt;i think you need to do sed s/_/ /g&lt;BR /&gt;&lt;BR /&gt;Chan</description>
      <pubDate>Thu, 18 May 2006 13:11:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790807#M264966</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2006-05-18T13:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790808#M264967</link>
      <description>Hi Manuales,&lt;BR /&gt;&lt;BR /&gt;You need to pipe the output of sed to the shell in order for the command to be executed i.e.&lt;BR /&gt;&lt;BR /&gt;replace...&lt;BR /&gt;echo $2 | sed 's/_/ /g'&lt;BR /&gt;with...&lt;BR /&gt;echo $2 | sed 's/_/ /g' | sh&lt;BR /&gt;&lt;BR /&gt;Only then the ftp will be executed.</description>
      <pubDate>Thu, 18 May 2006 13:18:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790808#M264967</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-05-18T13:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790809#M264968</link>
      <description>Hi Manuales:&lt;BR /&gt;&lt;BR /&gt;You don't need to perform the contortions of embedding underscore characters that you change to spaces.  Consider:&lt;BR /&gt;&lt;BR /&gt;# logftp="xxxxxx"&lt;BR /&gt;# VALOR="/usr/bin/ftp -v -n -i &amp;lt; ${logftp} &amp;gt; ${logftp}_out"&lt;BR /&gt;# ./showme DOTHISFORME "${VALOR}"&lt;BR /&gt;&lt;BR /&gt;If ./showme looks like this below, then the second argument received is your ${VALOR} string and the first argument will be "DOTHISFORME":&lt;BR /&gt;&lt;BR /&gt;# cat ./showme&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo $1 $2&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;In 'showme' you could execute ${VALOR} by writing:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "I was told $1 $2"&lt;BR /&gt;$2&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 18 May 2006 13:38:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790809#M264968</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-05-18T13:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790810#M264969</link>
      <description>Bad news ...&lt;BR /&gt;do not work  either  "${VALOR}" or "| sh" at the end of the sentence ...&lt;BR /&gt;&lt;BR /&gt;i do not know why!!!??&lt;BR /&gt;some time i read about comand exe or exec or something like that, do you know it?&lt;BR /&gt;I'm using /uar/bin/sh shell&lt;BR /&gt;Please help !!&lt;BR /&gt;&lt;BR /&gt;Thanks .</description>
      <pubDate>Thu, 18 May 2006 15:13:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790810#M264969</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2006-05-18T15:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790811#M264970</link>
      <description>Help ..</description>
      <pubDate>Thu, 18 May 2006 15:33:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790811#M264970</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2006-05-18T15:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790812#M264971</link>
      <description>Hi (again) Manuales:&lt;BR /&gt;&lt;BR /&gt;OK, since you are using redirection we need to modify the wrapper I provided by adding an 'eval' statement (see the 'sh-posix(1)' manpages):&lt;BR /&gt;&lt;BR /&gt;Consider again:&lt;BR /&gt;&lt;BR /&gt;# logftp="xxxxxx"&lt;BR /&gt;# VALOR="/usr/bin/ftp -v -n -i &amp;lt; ${logftp} &amp;gt; ${logftp}_out"&lt;BR /&gt;# ./launch DOING "${VALOR}"&lt;BR /&gt;&lt;BR /&gt;...where:&lt;BR /&gt;&lt;BR /&gt;# cat ./launch&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "$1 : $2"&lt;BR /&gt;eval  $2   # &amp;lt;--- NOTE&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 18 May 2006 16:04:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790812#M264971</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-05-18T16:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790813#M264972</link>
      <description>Manuales, &lt;BR /&gt;&lt;BR /&gt;if what you want to handle in your second script is &lt;BR /&gt;script2 param1 "/usr/bin/ftp -v -n -i &amp;lt; $logftp &amp;gt; ${logftp}_out" &lt;BR /&gt;&lt;BR /&gt;i would write script1 with&lt;BR /&gt;VALOR="/usr/bin/ftp -v -n -i &amp;lt; ${logftp} &amp;gt; ${logftp}_out"&lt;BR /&gt;script2 param1 "${VALOR}"&lt;BR /&gt;&lt;BR /&gt;and then in script2:&lt;BR /&gt;# retrieve first param&lt;BR /&gt;param1=$1&lt;BR /&gt;# retrieve rest of command line.&lt;BR /&gt;shift&lt;BR /&gt;param2=$* &lt;BR /&gt;&lt;BR /&gt;hope this helps. &lt;BR /&gt;antonio.&lt;BR /&gt;</description>
      <pubDate>Thu, 18 May 2006 16:05:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790813#M264972</guid>
      <dc:creator>Antonio Cardoso_1</dc:creator>
      <dc:date>2006-05-18T16:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790814#M264973</link>
      <description>Manuales,&lt;BR /&gt;&lt;BR /&gt;What is stored inside "logftp" variable. Not sure if the hostname you're trying to ftp to is contained in $logftp. Anyway post the output of the following:&lt;BR /&gt;&lt;BR /&gt;# echo $VALOR&lt;BR /&gt;# echo $logftp&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
      <pubDate>Thu, 18 May 2006 16:42:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790814#M264973</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-05-18T16:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why does not work a sentece kept in a variable when is delivered in other script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790815#M264974</link>
      <description>Manuales,&lt;BR /&gt;&lt;BR /&gt;in VALOR, change the underscores in blanks&lt;BR /&gt;&lt;BR /&gt;Then the line in script2 should read:&lt;BR /&gt;echo $*|sh&lt;BR /&gt;&lt;BR /&gt;If you like to keep the underscores, you have to write it like  ...&amp;lt;_${logftp}_&amp;gt;_${logftp}_out&lt;BR /&gt;because _$ seems to be something special for the shell and it 'eats' your variable.&lt;BR /&gt;In script2, then you should use:&lt;BR /&gt;echo $*|sed 's/_/ /g'|sh&lt;BR /&gt;&lt;BR /&gt;Greetings,&lt;BR /&gt;Philippe</description>
      <pubDate>Fri, 19 May 2006 03:55:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-does-not-work-a-sentece-kept-in-a-variable-when-is-delivered/m-p/3790815#M264974</guid>
      <dc:creator>Philippe Vervoort</dc:creator>
      <dc:date>2006-05-19T03:55:53Z</dc:date>
    </item>
  </channel>
</rss>

