All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 1/1] Use /bin/bash instead of /bin/sh
Date: Fri, 14 May 2010 13:14:55 +0200	[thread overview]
Message-ID: <4BED30AF.5030706@redhat.com> (raw)
In-Reply-To: <20100514104002.GQ2377@agk-dp.fab.redhat.com>

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



  reply	other threads:[~2010-05-14 11:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-05-14 11:26       ` Alasdair G Kergon
2010-05-14 10:40   ` Alasdair G Kergon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BED30AF.5030706@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.