<?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 I've got the subshell blues... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/i-ve-got-the-subshell-blues/m-p/6400507#M496476</link>
    <description>&lt;P&gt;HP-UX11.31, ksh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I have inherited a Korn Shell script that doesn't seem to work. Towards the end of it is the following code...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if [ -d CSC ]&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo "Making CSC first..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;( cd CSC ; csc change -A pa_hpux11 ;csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) || exit 1&lt;/P&gt;&lt;P&gt;# above on 1 line&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In very simple terms, the line "&amp;nbsp;( cd CSC ; csc change -A pa_hpux11 ;csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) || exit 1" doesn't do what I expect when it's run in the script, however if I run it from the command line it works fine. Plugging echos and cats into the line, when run in the script...&lt;/P&gt;&lt;P&gt;cd CSC works OK&lt;/P&gt;&lt;P&gt;csc change -A pa_hpux11 works OK&lt;/P&gt;&lt;P&gt;csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) doesn't&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, 'csc' is a binary executable, so I can't plug any debug commands into it, however, I have tried subsituting a noddy script for 'csc' which echos the supplied paramenters and they look OK when run from my ksh script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why that line behaves differently when run within a ksh script from when run on the command line?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;</description>
    <pubDate>Wed, 05 Mar 2014 13:41:14 GMT</pubDate>
    <dc:creator>Gary Cooper_1</dc:creator>
    <dc:date>2014-03-05T13:41:14Z</dc:date>
    <item>
      <title>I've got the subshell blues...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-ve-got-the-subshell-blues/m-p/6400507#M496476</link>
      <description>&lt;P&gt;HP-UX11.31, ksh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I have inherited a Korn Shell script that doesn't seem to work. Towards the end of it is the following code...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if [ -d CSC ]&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo "Making CSC first..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;( cd CSC ; csc change -A pa_hpux11 ;csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) || exit 1&lt;/P&gt;&lt;P&gt;# above on 1 line&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In very simple terms, the line "&amp;nbsp;( cd CSC ; csc change -A pa_hpux11 ;csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) || exit 1" doesn't do what I expect when it's run in the script, however if I run it from the command line it works fine. Plugging echos and cats into the line, when run in the script...&lt;/P&gt;&lt;P&gt;cd CSC works OK&lt;/P&gt;&lt;P&gt;csc change -A pa_hpux11 works OK&lt;/P&gt;&lt;P&gt;csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) doesn't&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, 'csc' is a binary executable, so I can't plug any debug commands into it, however, I have tried subsituting a noddy script for 'csc' which echos the supplied paramenters and they look OK when run from my ksh script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why that line behaves differently when run within a ksh script from when run on the command line?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 13:41:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-ve-got-the-subshell-blues/m-p/6400507#M496476</guid>
      <dc:creator>Gary Cooper_1</dc:creator>
      <dc:date>2014-03-05T13:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: I've got the subshell blues...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-ve-got-the-subshell-blues/m-p/6400995#M496477</link>
      <description>&lt;P&gt;&amp;gt;doesn't do what I expect when it's run in the script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does it do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;if I run it from the command line it works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This typically occurs because you haven't set up the right env vars.&amp;nbsp; Or you are using aliases.&lt;/P&gt;&lt;P&gt;(I have my ksh ENV file only set if interactive so I can't use aliases in my scripts.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;I have tried substituting a noddy script for csc which echoes the supplied parameters&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's what I would have done.&lt;/P&gt;&lt;P&gt;You could try using tusc:&lt;/P&gt;&lt;P&gt;tusc -fp -ea -o tusc.out script-name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And compare with the command line version.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 17:36:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-ve-got-the-subshell-blues/m-p/6400995#M496477</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-03-05T17:36:21Z</dc:date>
    </item>
  </channel>
</rss>

