<?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: scripting differences between hpux and linux in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189181#M461289</link>
    <description>Hey;&lt;BR /&gt;&lt;BR /&gt;As posted, it's almost certainly one more little difference between ksh and bash.  Bash is pretty close, but certainly not an exact copy of ksh.  Check out array definition for more entertaining differences.&lt;BR /&gt;&lt;BR /&gt;There are ksh rpms for linux.  Depending on the distro, it may already be installed.  Just switch the shell and you'll be good, I think.&lt;BR /&gt;&lt;BR /&gt;Doug O'Leary</description>
    <pubDate>Thu, 23 Jul 2009 13:09:41 GMT</pubDate>
    <dc:creator>Doug O'Leary</dc:creator>
    <dc:date>2009-07-23T13:09:41Z</dc:date>
    <item>
      <title>scripting differences between hpux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189178#M461286</link>
      <description>A simple test script:&lt;BR /&gt;&lt;BR /&gt;#!/usr/ksh&lt;BR /&gt;set -x&lt;BR /&gt;DN='"cn=Directory Manager"'&lt;BR /&gt;echo $DN&lt;BR /&gt;&lt;BR /&gt;The outcome on HP-UX is what I'm expecting:&lt;BR /&gt;home&amp;gt; ./test&lt;BR /&gt;+ DN="cn=Directory Manager"&lt;BR /&gt;+ echo "cn=Directory Manager"&lt;BR /&gt;"cn=Directory Manager"&lt;BR /&gt;&lt;BR /&gt;The outcome on Linux however is very slightly different:&lt;BR /&gt;&lt;BR /&gt;[root]# sh test&lt;BR /&gt;+ DN='"cn=Directory Manager"'&lt;BR /&gt;+ echo '"cn=Directory' 'Manager"'&lt;BR /&gt;"cn=Directory Manager"&lt;BR /&gt;&lt;BR /&gt;Anyone know why it's sticking the single quotes around the variable? When I pass ${DN} to a command later in the script it's failing because it splits it into ""cn=Directory" and "Manager"".&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jul 2009 12:49:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189178#M461286</guid>
      <dc:creator>Pete Des Moulins</dc:creator>
      <dc:date>2009-07-23T12:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: scripting differences between hpux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189179#M461287</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Different shell, minor minor variations in functionality.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://kornshell.com/" target="_blank"&gt;http://kornshell.com/&lt;/A&gt;&lt;BR /&gt;ksh&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.gnu.org/software/bash/manual/bashref.html" target="_blank"&gt;http://www.gnu.org/software/bash/manual/bashref.html&lt;/A&gt;&lt;BR /&gt;bash&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 23 Jul 2009 12:52:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189179#M461287</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-07-23T12:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: scripting differences between hpux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189180#M461288</link>
      <description>I noticed, on linux, you have run the command with &lt;BR /&gt;&lt;BR /&gt;sh test&lt;BR /&gt;&lt;BR /&gt;command, which in turn have used the default shell you were using at the time, more than likely bash&lt;BR /&gt;&lt;BR /&gt;does it run the same way if you call the script the same way you did in hpux machine ? I.e :&lt;BR /&gt;&lt;BR /&gt;./test&lt;BR /&gt;&lt;BR /&gt;Variable interpretations of shells are different for different shells.</description>
      <pubDate>Thu, 23 Jul 2009 12:57:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189180#M461288</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-07-23T12:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: scripting differences between hpux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189181#M461289</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;As posted, it's almost certainly one more little difference between ksh and bash.  Bash is pretty close, but certainly not an exact copy of ksh.  Check out array definition for more entertaining differences.&lt;BR /&gt;&lt;BR /&gt;There are ksh rpms for linux.  Depending on the distro, it may already be installed.  Just switch the shell and you'll be good, I think.&lt;BR /&gt;&lt;BR /&gt;Doug O'Leary</description>
      <pubDate>Thu, 23 Jul 2009 13:09:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189181#M461289</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2009-07-23T13:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: scripting differences between hpux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189182#M461290</link>
      <description>as others have pointed out, by doing "sh test" you are using a different shell - use the same shell (ksh) and you will get consistent results. I presume the line "#!/usr/ksh" at the top of your script was a typo for "#!/usr/bin/ksh". Here's what I get on my HP-UX/Linux systems:&lt;BR /&gt;&lt;BR /&gt;# uname -sr&lt;BR /&gt;HP-UX B.11.31&lt;BR /&gt;&lt;BR /&gt;# cat de.sh&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;set -x&lt;BR /&gt;DN="'cn=Directory Manager'"&lt;BR /&gt;echo "$DN"&lt;BR /&gt;&lt;BR /&gt;# ./de.sh&lt;BR /&gt;+ DN='cn=Directory Manager'&lt;BR /&gt;+ echo 'cn=Directory Manager'&lt;BR /&gt;'cn=Directory Manager'&lt;BR /&gt;&lt;BR /&gt;---------------------------------&lt;BR /&gt;&lt;BR /&gt;# uname -or&lt;BR /&gt;2.6.9-42.EL GNU/Linux&lt;BR /&gt;&lt;BR /&gt;# cat de.sh&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;set -x&lt;BR /&gt;DN="'cn=Directory Manager'"&lt;BR /&gt;echo "$DN"&lt;BR /&gt;&lt;BR /&gt;# ./de.sh&lt;BR /&gt;+ DN='cn=Directory Manager'&lt;BR /&gt;+ echo 'cn=Directory Manager'&lt;BR /&gt;'cn=Directory Manager'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As you can see - consistent...&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Thu, 23 Jul 2009 13:18:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189182#M461290</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2009-07-23T13:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: scripting differences between hpux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189183#M461291</link>
      <description>Once you put this line at the top&lt;BR /&gt;&lt;BR /&gt;#!/usr/ksh&lt;BR /&gt;&lt;BR /&gt;That is what the script is going to run under. If you have pdksh on the linux box, then it will run under the korn shell.</description>
      <pubDate>Thu, 23 Jul 2009 13:19:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189183#M461291</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2009-07-23T13:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: scripting differences between hpux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189184#M461292</link>
      <description>Hi Pete:&lt;BR /&gt;&lt;BR /&gt;I guess I have to ask why do you care, given that the differences are only in the trace?&lt;BR /&gt;&lt;BR /&gt;Using '/usr/bin/ksh' [or for that matter '/usr/bin/sh'] on an Itanium 11.23 server:&lt;BR /&gt;&lt;BR /&gt;+ DN="cn=Directory Manager"&lt;BR /&gt;+ echo "cn=Directory Manager"&lt;BR /&gt;"cn=Directory Manager"&lt;BR /&gt;&lt;BR /&gt;Using '/bin/bash' on an OpenSUSE 11 server:&lt;BR /&gt;&lt;BR /&gt;+ DN='"cn=Directory Manager"'&lt;BR /&gt;+ echo '"cn=Directory' 'Manager"'&lt;BR /&gt;"cn=Directory Manager"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jul 2009 13:21:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189184#M461292</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-07-23T13:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: scripting differences between hpux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189185#M461293</link>
      <description>.</description>
      <pubDate>Thu, 23 Jul 2009 13:28:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-differences-between-hpux-and-linux/m-p/5189185#M461293</guid>
      <dc:creator>Pete Des Moulins</dc:creator>
      <dc:date>2009-07-23T13:28:13Z</dc:date>
    </item>
  </channel>
</rss>

