<?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 Command Substitution is not working in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701933#M249463</link>
    <description>When I am calling a command from a perl script via command ticks i.e ` then if my command has a | it fails&lt;BR /&gt;eg.&lt;BR /&gt;&lt;SOMEVARIABLE&gt;=`ls | wc -l` doesn't give me any output in the variable&lt;BR /&gt;but &lt;SOMEVARIABLE&gt;=`ls`  works&lt;BR /&gt;&lt;BR /&gt;The same works on other servers. Perl instalation, version, modules etc is all the same. | works on command prompt but not via programs&lt;BR /&gt;&lt;BR /&gt;$ uname -a &lt;BR /&gt;HP-UX Server_Name  B.11.11 U 9000/800 1849201262 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;$ perl -v &lt;BR /&gt;&lt;BR /&gt;This is perl, v5.8.7 built for PA-RISC2.0-thread-multi&lt;/SOMEVARIABLE&gt;&lt;/SOMEVARIABLE&gt;</description>
    <pubDate>Wed, 04 Jan 2006 01:49:23 GMT</pubDate>
    <dc:creator>vinodan</dc:creator>
    <dc:date>2006-01-04T01:49:23Z</dc:date>
    <item>
      <title>Command Substitution is not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701933#M249463</link>
      <description>When I am calling a command from a perl script via command ticks i.e ` then if my command has a | it fails&lt;BR /&gt;eg.&lt;BR /&gt;&lt;SOMEVARIABLE&gt;=`ls | wc -l` doesn't give me any output in the variable&lt;BR /&gt;but &lt;SOMEVARIABLE&gt;=`ls`  works&lt;BR /&gt;&lt;BR /&gt;The same works on other servers. Perl instalation, version, modules etc is all the same. | works on command prompt but not via programs&lt;BR /&gt;&lt;BR /&gt;$ uname -a &lt;BR /&gt;HP-UX Server_Name  B.11.11 U 9000/800 1849201262 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;$ perl -v &lt;BR /&gt;&lt;BR /&gt;This is perl, v5.8.7 built for PA-RISC2.0-thread-multi&lt;/SOMEVARIABLE&gt;&lt;/SOMEVARIABLE&gt;</description>
      <pubDate>Wed, 04 Jan 2006 01:49:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701933#M249463</guid>
      <dc:creator>vinodan</dc:creator>
      <dc:date>2006-01-04T01:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Command Substitution is not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701934#M249464</link>
      <description>Can you try like this,&lt;BR /&gt;&lt;BR /&gt;perl -e '$var=`ls | wc -l`;print $var;'&lt;BR /&gt;&lt;BR /&gt;It has to work.&lt;BR /&gt;&lt;BR /&gt;-Muthu</description>
      <pubDate>Wed, 04 Jan 2006 02:05:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701934#M249464</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-01-04T02:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Command Substitution is not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701935#M249465</link>
      <description>Hi,&lt;BR /&gt;It doesn't work&lt;BR /&gt;&lt;BR /&gt;testsw /home/testsw&amp;gt;perl -e '$var=`ls | wc -l`;print $var;'&lt;BR /&gt;testsw /home/testsw&amp;gt;&lt;BR /&gt;&lt;BR /&gt;but&lt;BR /&gt;&lt;BR /&gt;testsw /home/testsw&amp;gt;perl -e '$var=`ls`;print $var;'&lt;BR /&gt;a.pl&lt;BR /&gt;data&lt;BR /&gt;ftpdtls.txt&lt;BR /&gt;ftpuploaddtls.txt&lt;BR /&gt;getPatchInfo&lt;BR /&gt;getclientdetails.pl&lt;BR /&gt;maintainhash&lt;BR /&gt;maintainhashcron.sh&lt;BR /&gt;nohup.out&lt;BR /&gt;setdistenv&lt;BR /&gt;testing.sh&lt;BR /&gt;testsw /home/testsw&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So i'm back to where I was, the | doesn't work from perl &lt;BR /&gt;</description>
      <pubDate>Wed, 04 Jan 2006 02:19:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701935#M249465</guid>
      <dc:creator>vinodan</dc:creator>
      <dc:date>2006-01-04T02:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Command Substitution is not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701936#M249466</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;# perl -We '$var=`ls | wc -l`;print $var;'&lt;BR /&gt;# perl -We '$var=qx[ls | wc -l];print $var;'&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Wed, 04 Jan 2006 03:07:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701936#M249466</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-01-04T03:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Command Substitution is not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701937#M249467</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;what is with the other pipe-operators (&amp;lt;,&amp;gt;,|)?&lt;BR /&gt;does this works?&lt;BR /&gt;&lt;BR /&gt;#perl -e '`ls &amp;gt; list`;'&lt;BR /&gt;#cat list&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Jan 2006 03:24:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701937#M249467</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2006-01-04T03:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Command Substitution is not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701938#M249468</link>
      <description>So this is a problem on only one system, is that right?&lt;BR /&gt;&lt;BR /&gt;Perhaps it's not a problem with perl, but with the environment you're running it in.  What shell are you running on the system that doesn't work, and what on the systems that do?&lt;BR /&gt;&lt;BR /&gt;What is the output of 'stty -a' on the non-working and working systems? &lt;BR /&gt;&lt;BR /&gt;What happens if you put the line in a file, and run that (e.g. put the line in a file and run the file with 'sh /tmp/filename' or even 'sh -x /tmp/filename')?&lt;BR /&gt;&lt;BR /&gt;Andrew</description>
      <pubDate>Wed, 04 Jan 2006 07:58:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701938#M249468</guid>
      <dc:creator>Andrew Merritt_2</dc:creator>
      <dc:date>2006-01-04T07:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Command Substitution is not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701939#M249469</link>
      <description>As I was reading this, I began to suspect where Andrew went with it, that is, maybe you've got the "|" redefined in your stty settings.&lt;BR /&gt;&lt;BR /&gt;run "stty -a" and see if you see a "|" symbol in there.</description>
      <pubDate>Wed, 04 Jan 2006 10:21:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/command-substitution-is-not-working/m-p/3701939#M249469</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-01-04T10:21:20Z</dc:date>
    </item>
  </channel>
</rss>

