[lvm-devel] [PATCH 1/1] Use /bin/bash instead of /bin/sh

Zdenek Kabelac zkabelac at redhat.com
Fri May 14 11:14:55 UTC 2010


Dne 14.5.2010 12:40, Alasdair G Kergon napsal(a):
> On Fri, May 14, 2010 at 10:28:25AM +0200, Zdenek Kabelac wrote:
>> Use /bin/bash for scripts using bashisms.
>> For all of them 'checkbashisms' command reports miscelanous things
>> available only in nonstandard shell extensions like bash.
>  
> Please post the output so we can see.
> 

Some of them could be easily fixed - some of them are trickier (i.e.
${RANDOM}) - as we already use bash for other scripts anyway - I've considered
it's fairly easier to use bash for these as well...

Zdenek

------------------

scripts/clvmd_fix_conf.sh
possible bashism in scripts/clvmd_fix_conf.sh line 35 (${foo:3[:1]}):
  if [ "${PREFIX:0:1}" != "/" ]
possible bashism in scripts/clvmd_fix_conf.sh line 135 (echo -e):
    echo -e $SEDCMD > $SCRIPTFILE
------------------
scripts/fsadm.sh
possible bashism in scripts/fsadm.sh line 63 ($RANDOM):
TEMPDIR="${TMPDIR:-/tmp}/${TOOL}_${RANDOM}$$/m"
possible bashism in scripts/fsadm.sh line 119 (trap with signal numbers):
	trap '' 2
------------------
scripts/last_cvs_update.sh
possible bashism in scripts/last_cvs_update.sh line 36 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ -z $1 ]];
possible bashism in scripts/last_cvs_update.sh line 39 (alternative test
command ([[ foo ]] should be [ foo ])):
 if [[ $1 == "-h" ]];
possible bashism in scripts/last_cvs_update.sh line 39 (should be 'b = a'):
 if [[ $1 == "-h" ]];
possible bashism in scripts/last_cvs_update.sh line 43 (alternative test
command ([[ foo ]] should be [ foo ])):
   if [[ -d $1 ]]
possible bashism in scripts/last_cvs_update.sh line 53 (alternative test
command ([[ foo ]] should be [ foo ])):
if [[ -f $path/CVS/Tag ]];
------------------
scripts/lvmconf.sh
possible bashism in scripts/lvmconf.sh line 19 ('function' is useless):
function usage
possible bashism in scripts/lvmconf.sh line 34 ('function' is useless):
function parse_args
possible bashism in scripts/lvmconf.sh line 80 ('function' is useless):
function validate_args
possible bashism in scripts/lvmconf.sh line 97 (${foo:3[:1]}):
        if [ "${LOCKINGLIBDIR:0:1}" != "/" ]
possible bashism in scripts/lvmconf.sh line 236 (echo -e):
    echo -e $SEDCMD > $SCRIPTFILE
------------------
scripts/lvmconf_lockingtype2.sh
possible bashism in scripts/lvmconf_lockingtype2.sh line 19 ('function' is
useless):
function usage
possible bashism in scripts/lvmconf_lockingtype2.sh line 34 ('function' is
useless):
function parse_args
possible bashism in scripts/lvmconf_lockingtype2.sh line 80 ('function' is
useless):
function validate_args
possible bashism in scripts/lvmconf_lockingtype2.sh line 99 (${foo:3[:1]}):
        if [ "${LOCKINGLIBDIR:0:1}" != "/" ]
possible bashism in scripts/lvmconf_lockingtype2.sh line 233 (echo -e):
    echo -e $SEDCMD > $SCRIPTFILE
------------------
scripts/vgimportclone.sh
possible bashism in scripts/vgimportclone.sh line 40 (should be >word 2>&1):
"$LVM" version >& /dev/null || die 2 "Could not run lvm binary '$LVM'"
possible bashism in scripts/vgimportclone.sh line 43 ('function' is useless):
function getvgname {
possible bashism in scripts/vgimportclone.sh line 55 (alternative test command
([[ foo ]] should be [ foo ])):
    while [[ "${VGLIST}" =~ "${NAME}" ]]
possible bashism in scripts/vgimportclone.sh line 64 ('function' is useless):
function checkvalue {
possible bashism in scripts/vgimportclone.sh line 73 ('function' is useless):
function usage {
possible bashism in scripts/vgimportclone.sh line 89 ('function' is useless):
function cleanup {
possible bashism in scripts/vgimportclone.sh line 103 ($UID should be "$(id
-ru)"):
if [ "$UID" != "0" -a "$EUID" != "0" ]
possible bashism in scripts/vgimportclone.sh line 103 ($EUID should be "$(id
-u)"):
if [ "$UID" != "0" -a "$EUID" != "0" ]
possible bashism in scripts/vgimportclone.sh line 125 (trap with signal numbers):
trap  cleanup 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
possible bashism in scripts/vgimportclone.sh line 154 (let ...):
            let VERBOSE_COUNT=VERBOSE_COUNT+1
possible bashism in scripts/vgimportclone.sh line 320 (alternative test
command ([[ foo ]] should be [ foo ])):
    if [[ "${PVLIST}" =~ "unknown" ]]
------------------




More information about the lvm-devel mailing list