All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Use bash
@ 2010-05-14  8:28 Zdenek Kabelac
  2010-05-14  8:28 ` [PATCH 1/1] Use /bin/bash instead of /bin/sh Zdenek Kabelac
  0 siblings, 1 reply; 6+ messages in thread
From: Zdenek Kabelac @ 2010-05-14  8:28 UTC (permalink / raw)
  To: lvm-devel

Zdenek Kabelac (1):
  Use /bin/bash instead of /bin/sh

 scripts/clvmd_fix_conf.sh       |    2 +-
 scripts/fsadm.sh                |    2 +-
 scripts/last_cvs_update.sh      |    2 +-
 scripts/lvmconf.sh              |    2 +-
 scripts/lvmconf_lockingtype2.sh |    2 +-
 scripts/vgimportclone.sh        |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] Use /bin/bash instead of /bin/sh
  2010-05-14  8:28 [PATCH 0/1] Use bash Zdenek Kabelac
@ 2010-05-14  8:28 ` Zdenek Kabelac
  2010-05-14 10:40   ` Alasdair G Kergon
  2010-05-14 10:40   ` Alasdair G Kergon
  0 siblings, 2 replies; 6+ messages in thread
From: Zdenek Kabelac @ 2010-05-14  8:28 UTC (permalink / raw)
  To: lvm-devel

Use /bin/bash for scripts using bashisms.
For all of them 'checkbashisms' command reports miscelanous things
available only in nonstandard shell extensions like bash.

For more details check i.e.: https://wiki.ubuntu.com/DashAsBinSh

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 scripts/clvmd_fix_conf.sh       |    2 +-
 scripts/fsadm.sh                |    2 +-
 scripts/last_cvs_update.sh      |    2 +-
 scripts/lvmconf.sh              |    2 +-
 scripts/lvmconf_lockingtype2.sh |    2 +-
 scripts/vgimportclone.sh        |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/clvmd_fix_conf.sh b/scripts/clvmd_fix_conf.sh
index a00263c..cc2c50d 100644
--- a/scripts/clvmd_fix_conf.sh
+++ b/scripts/clvmd_fix_conf.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Edit an lvm.conf file to enable cluster locking.
 #
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 13b48a0..90a93ee 100644
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2007-2009 Red Hat, Inc. All rights reserved.
 #
diff --git a/scripts/last_cvs_update.sh b/scripts/last_cvs_update.sh
index e38d0ec..7b5afea 100755
--- a/scripts/last_cvs_update.sh
+++ b/scripts/last_cvs_update.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #$Header$
 ################################################################################
 ##
diff --git a/scripts/lvmconf.sh b/scripts/lvmconf.sh
index bf1494b..3caaf91 100644
--- a/scripts/lvmconf.sh
+++ b/scripts/lvmconf.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
 #
diff --git a/scripts/lvmconf_lockingtype2.sh b/scripts/lvmconf_lockingtype2.sh
index f5c4313..b823a43 100644
--- a/scripts/lvmconf_lockingtype2.sh
+++ b/scripts/lvmconf_lockingtype2.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
 #
diff --git a/scripts/vgimportclone.sh b/scripts/vgimportclone.sh
index ecf0546..731b860 100755
--- a/scripts/vgimportclone.sh
+++ b/scripts/vgimportclone.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Copyright (C) 2009 Chris Procter All rights reserved.
 # Copyright (C) 2009 Red Hat, Inc. All rights reserved.
-- 
1.7.0.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/1] Use /bin/bash instead of /bin/sh
  2010-05-14  8:28 ` [PATCH 1/1] Use /bin/bash instead of /bin/sh Zdenek Kabelac
@ 2010-05-14 10:40   ` Alasdair G Kergon
  2010-05-14 11:14     ` Zdenek Kabelac
  2010-05-14 10:40   ` Alasdair G Kergon
  1 sibling, 1 reply; 6+ messages in thread
From: Alasdair G Kergon @ 2010-05-14 10:40 UTC (permalink / raw)
  To: lvm-devel

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.

Alasdair



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] Use /bin/bash instead of /bin/sh
  2010-05-14  8:28 ` [PATCH 1/1] Use /bin/bash instead of /bin/sh Zdenek Kabelac
  2010-05-14 10:40   ` Alasdair G Kergon
@ 2010-05-14 10:40   ` Alasdair G Kergon
  1 sibling, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2010-05-14 10:40 UTC (permalink / raw)
  To: lvm-devel

On Fri, May 14, 2010 at 10:28:25AM +0200, Zdenek Kabelac wrote:
> Use /bin/bash for scripts using bashisms.

Ack.

Alasdair



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] Use /bin/bash instead of /bin/sh
  2010-05-14 10:40   ` Alasdair G Kergon
@ 2010-05-14 11:14     ` Zdenek Kabelac
  2010-05-14 11:26       ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: Zdenek Kabelac @ 2010-05-14 11:14 UTC (permalink / raw)
  To: lvm-devel

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" ]]
------------------



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] Use /bin/bash instead of /bin/sh
  2010-05-14 11:14     ` Zdenek Kabelac
@ 2010-05-14 11:26       ` Alasdair G Kergon
  0 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2010-05-14 11:26 UTC (permalink / raw)
  To: lvm-devel

On Fri, May 14, 2010 at 01:14:55PM +0200, Zdenek Kabelac wrote:
> 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...
 
Well it's fine to use some of those helpful bash extensions - pretty much every
system has it available these days - but we should still clean up the ones here
where the original syntax is equally good.

Alasdair



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-14 11:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-14  8:28 [PATCH 0/1] Use bash Zdenek Kabelac
2010-05-14  8:28 ` [PATCH 1/1] Use /bin/bash instead of /bin/sh Zdenek Kabelac
2010-05-14 10:40   ` Alasdair G Kergon
2010-05-14 11:14     ` Zdenek Kabelac
2010-05-14 11:26       ` Alasdair G Kergon
2010-05-14 10:40   ` Alasdair G Kergon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.