Question
Aig
US
Last activity: 23 Feb 2016 15:38 EST
./upgrade.sh: syntax error at line 24: `j=$' unexpected
I am trying to run upgrade.sh script from solaris box using korn or bash shell and it fails either with below message.syntax error at line 24: `j=$' unexpected.
The script runs correctly on an AIX box and we are successful with upgrade.But I would like to know if anyone faced this issue.I am trying to upgrade from 5.5 SP1 to & 7.1.8.
Thanks
Dinu
-
Like (0)
Tejaswini Silivear fredy alexander arango prieto -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
I think that post's title is misleading. He seems to be saying that on Solaris 10 the default /bin/sh interpreter is actually the original Bourne Shell and therefore does support the expanded functionality (included in bash) which they use in their scripts. A very similar problem prompted us to rewrite our shell scripts to be POSIX-compliant.
That said, if the script is being run using "./upgrade.sh" it will use the default interpreter, whatever that may be. This link provides some details on how to determine which shell you're running by default and how to configure it. Additionally, you can run a shell script with a particular interpreter by running the command as "/path/to/interpreter /path/to/upgrade.sh".
Pegasystems Inc.
US
Hi Dinu,
I also encourage you to look at our Upgrade Center community to see if you can find/discuss this with others focused on the upgrade to Pega 7.
Thanks.
B.
Pegasystems Inc.
US
can you provide your solaris os version? Sometimes old bash version could cause similar issues. Type bash -version to check.
Aig
US
/opt/soft/pega-718/scripts)$bash -version
GNU bash,
version 3.2.57(1)-release (sparc-sun-solaris2.10)
Pegasystems Inc.
US
ok, you are running Solaris 10, which should be supported. Can you try the attached the script and report the outcome?
Pegasystems Inc.
US
Here it is.
Aig
US
Same error with updated upgrade.sh
Pegasystems Inc.
US
ok, can you specify the exact OS version of your solaris server and create a SR for further investigation if you do want to continue.
Pegasystems Inc.
US
Davis Walsh, can you take a quick to look to see if this is something obvious to you? I do not have a Solaris box to test the script.
Pegasystems Inc.
US
The commands we use in that script should be POSIX compliant, so i would expect it to work with any sh-based interpreter (including bash). If you have another interpreter available (sh, ksh, etc.) you could try one of those.
Pegasystems Inc.
US
I wonder if solaris 10 bash shell is POSIX compliant especially some older versions, found something similar to this: Scripts assume /bin/sh is POSIX compliant · Issue #85 · github/backup-utils · GitHub. I believe Dinu already tried ksh. The link here simply suggests that Solaris 10 is not POSIX compliant, that would explain the failure.
Accepted Solution
Pegasystems Inc.
US
I think that post's title is misleading. He seems to be saying that on Solaris 10 the default /bin/sh interpreter is actually the original Bourne Shell and therefore does support the expanded functionality (included in bash) which they use in their scripts. A very similar problem prompted us to rewrite our shell scripts to be POSIX-compliant.
That said, if the script is being run using "./upgrade.sh" it will use the default interpreter, whatever that may be. This link provides some details on how to determine which shell you're running by default and how to configure it. Additionally, you can run a shell script with a particular interpreter by running the command as "/path/to/interpreter /path/to/upgrade.sh".
Aig
US
default interpreter --> GNU bash, version 3.2.57(1)-release (sparc-sun-solaris2.10)
Aig
US
The default interpreter was $echo $SHELL
/bin/ksh after explicitly changing it to /var/tmp/126546-08/SUNWbash/reloc/usr/bin/bash it worked, thank you all for your help.
Pegasystems Inc.
US
just for the knowledge of everyone, does this mean that it did not work for ksh (which may not be POSIX compliant) but work for bash (even the 3.2 version)?
Aig
US
Strange..I requestedd the default interepreter in aix $echo $SHELL /usr/bin/ksh and there it is KSH and script ran correctly.
Pegasystems Inc.
US
this means that the issue only exists in your solaris box for ksh, that seems to be the culprit.
Pegasystems Inc.
US
In the interest of identifying the crux of the issue here, can you post the exact versions of KSH used on each system? We would like to better articulate the supported interpreters in the Platform Support Guide. Thanks!
Aig
US
ksh version in aix: 0403-010(upgrade script ran correctly)
ksh Version in solaris: M-11/16/88i( upgrade script failed with syntax error)
Aig
US
Hi,Is this a supported version ksh Version in solaris: M-11/16/88i( upgrade script failed with syntax error) ?
Pegasystems Inc.
US
I suggest you confirm with Oracle to see if that version is POSIX certified (normally requiring passing some automatic tests). Oracle is pretty weak in sharing those information publically (versus IBM) - I do not have access to its support site (your Solaris admin should have). From what I read, Solaris 11 is POSIX certified, which implies it may not be the case for Solaris 10.
Aig
US
solaris 10 posix
standard release was as below. Solaris 10 supports IEEE Std 1003.1 and IEEE Std
1003.2, commonly known as POSIX.1 and POSIX.2, respectively.
POSIX.1–2001 |
POSIX.1-1990, POSIX.1b-1993, POSIX.1c-1996, POSIX.2-1992, and POSIX.2a-1992 |
Solaris 10 |
please refer http://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html
Updated: 19 Feb 2016 13:41 EST
Pegasystems Inc.
US
Base on this link, it seems like this implementation of ksh is specific to Solaris. It's possible there is a bug in the implementation.
Pegasystems Inc.
US
Dinu,
Can you have your Solaris admin confirm with Oracle support? If this is indeed a bug in Solaris ksh implementation, we can then add a note to our platform guide.
Aig
US
Some howwww.in-ulm.de/~mascheck/various/shells/ksh_versions.html i am not seeing anything throug this link.Can you please post the content.
Pegasystems Inc.
US
It looks like the link is broken. Try this: http://www.in-ulm.de/~mascheck/various/shells/ksh_versions.html
Aig
US
Root cause has been identified.After changing the upgrade.sh header to #!/bin/ksh script ran in solaris ksh.That means in AIX, /bin/sh == /bin/ksh and In Solaris, /bin/sh != /bin/ksh.Pega instruction document has to be updated with this information.
Aig
US
I Already tried ksh and it failed with same error.Also it worked on aix with bash version 4.2
Pegasystems Inc.
US
understood. Can you upgrade your solaris 10 bash version to 4.2+ and retry?
Aig
US
Yes ,I have requested and will keep you posted on outcome.