[Linux-PowerEdge] Request: improve script quality

lhecking at users.sourceforge.net lhecking at users.sourceforge.net
Mon Aug 29 04:22:00 CDT 2016


 
>    Thanks for feedback.  We are able to install the same package successfully
>    on the RHEL operating system. What is operating system installed on your
>    system?
 
 CentOS 6.

Sven Ulland writes:
> This is due to the DUP scripts being written in bash, but the interpreter
> (shebang on the first line) points to /bin/sh. On RHEL and related systems,
> this is fine, because /bin/sh will invoke a shell with full bash
> compatibility. On others, like those derived from Debian, /bin/sh will
> invoke a shell with only bourne compatibility (not bourne *again*), or more
> recently, a more POSIX sh-like shell like dash.
> 
> I would suggest to fix the DUP infrastructure to use the appropriate script
> interpreter (i.e. setting it to /bin/bash), so that it works on platforms
> other than RHEL/etc.
 
# lsb_release -d
Description:    CentOS release 6.8 (Final)
# ll /bin/sh
lrwxrwxrwx 1 root root 4 Jun 14 10:53 /bin/sh -> bash
# 

 CentOS is supposed to be fully compatible with RHEL. This is not a matter of
 RHEL vs. others, it'a a matter of poor coding. E.g. from
 Diagnostics_Application_298ND_LN64_2.0_A00-2.0-16.08.00.noarch.rpm,
 Diagnostics_Application_298ND_LN64_2.0_A00.BIN :

getPSCommand()
{
        _ESXiSYSTEM=$(checkIfESXi)
        if [ $_ESXiSYSTEM = 0 ]; then
                echo "ps"
        else
                echo "ps -e"
        fi
}

 $_ESXiSYSTEM needs to be quoted. Trivial error, trivial fix. There are many
 more instances.



More information about the Linux-PowerEdge mailing list