Skip to content

Commit

Permalink
Bashisms fixed:
Browse files Browse the repository at this point in the history
possible bashism in ./rsnapshot/rsnapshot-wrapper.sh line 168 (test -a/-o):
        if [ ! -d "$CONFDIR" -o -z "$LOG" -o -z "$PIDFILE" ]; then
possible bashism in ./funiq.sh line 11 (test -a/-o):
if [ "$1" = "-s" -a -n "$2" ]; then
possible bashism in ./checksum_file.sh line 42 (test -a/-o):
if [ $# -ne 2 -o ! -f "$2" ]; then
possible bashism in ./benchmarks/ssh-performance.sh line 11 (test -a/-o):
if [ ! -f "$1" -o $# -ne 3 ]; then
possible bashism in ./benchmarks/cryptsetup_benchmark.sh line 9 (test -a/-o):
if [ ! -b "$1" -o -z "$4" ]; then
possible bashism in ./benchmarks/fs-bench.sh line 56 (test -a/-o):
if [ ! -b "$1" -o ! -d "$2" -o ! -f $CONF ]; then
possible bashism in ./benchmarks/fs-bench.sh line 192 (test -a/-o):
        if [ "`uname -s`" = Linux -a -z "`pgrep zfs-fuse`" ]; then
possible bashism in ./benchmarks/fs-bench.sh line 406 (test -a/-o):
[ `expr $NUMDIRS_C - 1` = $NUMDIRS -a $NUMFILES_C = `expr $NUMDIRS \* $NUMFILES` ] || ERR="- FAILED"
possible bashism in ./benchmarks/fs-bench.sh line 439 (test -a/-o):
[ `expr $NUMDIRS_C - 1` = $NUMFILES -a $NUMFILES_C = `expr $NUMDIRS \* $NUMFILES` ] || ERR="- FAILED"
possible bashism in ./kerninst.sh line 58 (test -a/-o):
if   [ -d "$2" -a -x "$2"/vmlinux ]; then
possible bashism in ./convert-music.sh line 23 (test -a/-o):
if [ ! $# -eq 2 -o ! -f "$2" ]; then
possible bashism in ./convert-music.sh line 89 (test -a/-o):
        if [ -z "$ARTIST" -o -z "$TITLE" ]; then
possible bashism in ./security_checks.sh line 17 (test -a/-o):
if [ -f "$STATE" -a ! -L "$STATE" ]; then

 benchmarks/cryptsetup_benchmark.sh |    2 +-
 benchmarks/fs-bench.sh             |    8 ++++----
 benchmarks/ssh-performance.sh      |    2 +-
 checksum_file.sh                   |    2 +-
 convert-music.sh                   |    4 ++--
 funiq.sh                           |    7 +++----
 kerninst.sh                        |    2 +-
 rsnapshot/rsnapshot-wrapper.sh     |    2 +-
 security_checks.sh                 |    2 +-
 9 files changed, 15 insertions(+), 16 deletions(-)

Signed-off-by: Christian Kujau <lists@nerdbynature.de>
  • Loading branch information
ckujau committed May 1, 2016
1 parent 30ec5b5 commit 3591342
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion benchmarks/cryptsetup_benchmark.sh
Expand Up @@ -6,7 +6,7 @@

# DEBUG=echo

if [ ! -b "$1" -o -z "$4" ]; then
if [ ! -b "$1" ] || [ -z "$4" ]; then
echo "Usage: $0 [device] [cipher] [size] [runs]"
echo "Examples:"
echo "`basename $0` /dev/sdu1 aes-cbc-plain 128"
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/fs-bench.sh
Expand Up @@ -53,7 +53,7 @@ fi
}

# sanity checks
if [ ! -b "$1" -o ! -d "$2" -o ! -f $CONF ]; then
if [ ! -b "$1" ] || [ ! -d "$2" ] || [ ! -f $CONF ]; then
log "Usage: `basename $0` [dev] [mpt]"
log "Make sure $CONF exists!" 1
else
Expand Down Expand Up @@ -189,7 +189,7 @@ umountfs() {
case $fs in
zfs)
# ...and special case Linux/ZFS again
if [ "`uname -s`" = Linux -a -z "`pgrep zfs-fuse`" ]; then
if [ "`uname -s`" = Linux ] && [ -z "`pgrep zfs-fuse`" ]; then
log "zfs-fuse not running!" 1
fi
$DEBUG sync
Expand Down Expand Up @@ -403,7 +403,7 @@ GEN_END=$(date +%s)
GEN_DUR=`echo "scale=2; $GEN_END - $GEN_BEGIN" | bc -l`
NUMDIRS_C=`find $MPT/manyfiles -type d | wc -l`
NUMFILES_C=`find $MPT/manyfiles -type f | wc -l`
[ `expr $NUMDIRS_C - 1` = $NUMDIRS -a $NUMFILES_C = `expr $NUMDIRS \* $NUMFILES` ] || ERR="- FAILED"
[ `expr $NUMDIRS_C - 1` = $NUMDIRS ] && [ $NUMFILES_C = `expr $NUMDIRS \* $NUMFILES` ] || ERR="- FAILED"
log "$FSP.4: $GEN_DUR seconds to create $NUMFILES files in each of the $NUMDIRS directories $ERR" >> $LOG/raw/generic-$fs.log
ERR=""

Expand Down Expand Up @@ -436,7 +436,7 @@ GEN_END=$(date +%s)
GEN_DUR=`echo "scale=2; $GEN_END - $GEN_BEGIN" | bc -l`
NUMDIRS_C=`find $MPT/manydirs -type d | wc -l`
NUMFILES_C=`find $MPT/manydirs -type f | wc -l`
[ `expr $NUMDIRS_C - 1` = $NUMFILES -a $NUMFILES_C = `expr $NUMDIRS \* $NUMFILES` ] || ERR="- FAILED"
[ `expr $NUMDIRS_C - 1` = $NUMFILES ] && [ $NUMFILES_C = `expr $NUMDIRS \* $NUMFILES` ] || ERR="- FAILED"
log "$FSP.6: $GEN_DUR seconds to create $NUMDIRS files in each of the $NUMFILES directories $ERR" >> $LOG/raw/generic-$fs.log
ERR=""

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/ssh-performance.sh
Expand Up @@ -8,7 +8,7 @@
#
# The ssh-eval.log must be created with ssh-features.sh.
#
if [ ! -f "$1" -o $# -ne 3 ]; then
if [ ! -f "$1" ] || [ $# -ne 3 ]; then
echo "Usage: $(basename $0) [ssh-eval.log] [user@][host] [size-in-MB]"
exit 1
else
Expand Down
2 changes: 1 addition & 1 deletion checksum_file.sh
Expand Up @@ -39,7 +39,7 @@ print_usage()
echo " `basename $0` [remove] [file]"
}

if [ $# -ne 2 -o ! -f "$2" ]; then
if [ $# -ne 2 ] || [ ! -f "$2" ]; then
print_usage
exit 1
else
Expand Down
4 changes: 2 additions & 2 deletions convert-music.sh
Expand Up @@ -20,7 +20,7 @@
# Convert Flac to Mp3
# https://wiki.archlinux.org/index.php/Convert_Flac_to_Mp3
#
if [ ! $# -eq 2 -o ! -f "$2" ]; then
if [ ! $# -eq 2 ] || [ ! -f "$2" ]; then
echo "Usage: `basename $0` [conversion] [file]"
echo "Conversions: flac2mp3, m4a2mp3, ogg2mp3"
exit 1
Expand Down Expand Up @@ -86,7 +86,7 @@ case $CONVERSION in
OUTPUT=${FILE%.ogg}.mp3
eval `ogginfo -qv "$FILE" | awk '/ARTIST/ || /TITLE/' | sed 's/^ //'`
# echo "ARTIST: $ARTIST TITLE: $TITLE"
if [ -z "$ARTIST" -o -z "$TITLE" ]; then
if [ -z "$ARTIST" ] || [ -z "$TITLE" ]; then
echo "WARNING: Not enough metadata, trying to gather track information from filename! ($FILE)"
TRACK=$(ls "$FILE" | awk -F\ '{print $1}')
TITLE=$(ls "$FILE" | sed 's/^[0-9]* - //;s/\.ogg//')
Expand Down
7 changes: 3 additions & 4 deletions funiq.sh
Expand Up @@ -4,13 +4,12 @@
# Fuzzy uniq (or Parsing Connect:Direct stats part 3)
# http://cdunix.blogspot.com/2008/10/fuzzy-uniq-or-parsing-connectdirect.html
#
# Get percentage of similarity from -s command line option, or 85 for default
# Get percentage of similarity from command line option, or 85 for default
#

# Percentage of similarity
if [ "$1" = "-s" -a -n "$2" ]; then
SIM=$2
shift 2
if [ -n "$1" ]; then
SIM=$1
else
SIM=85
fi
Expand Down
2 changes: 1 addition & 1 deletion kerninst.sh
Expand Up @@ -55,7 +55,7 @@ else
fi

# We might specify a build directory
if [ -d "$2" -a -x "$2"/vmlinux ]; then
if [ -d "$2" ] && [ -x "$2"/vmlinux ]; then
BUILDDIR="$2"
OPTIONS="O=$BUILDDIR"

Expand Down
2 changes: 1 addition & 1 deletion rsnapshot/rsnapshot-wrapper.sh
Expand Up @@ -165,7 +165,7 @@ else
. "$CONF"

# We need these to run
if [ ! -d "$CONFDIR" -o -z "$LOG" -o -z "$PIDFILE" ]; then
if [ ! -d "$CONFDIR" ] || [ -z "$LOG" ] || [ -z "$PIDFILE" ]; then
log "**** Please check CONFDIR, LOG, PIDFILE in $CONF!" 1
fi

Expand Down
2 changes: 1 addition & 1 deletion security_checks.sh
Expand Up @@ -14,7 +14,7 @@ MAXAGE=7
# DEBUG=echo

# BTS# 231267
if [ -f "$STATE" -a ! -L "$STATE" ]; then
if [ -f "$STATE" ] && [ ! -L "$STATE" ]; then
:
else
$DEBUG rm -f "$STATE"
Expand Down

0 comments on commit 3591342

Please sign in to comment.