Double quote to prevent globbing and word splitting.

Do not use legacy backticks.
Proper use of printf
Do not use wc -l with grep, instead use grep -c
Use pgrep

Signed-off-by: Werner Buck <wernerbuck@gmail.com>
This commit is contained in:
Werner Buck 2015-05-29 13:42:34 +02:00
parent 54202b3b41
commit f4aab9c8c5
9 changed files with 87 additions and 87 deletions

View file

@ -10,10 +10,10 @@ abspath () { case "$1" in /*)printf "%s\n" "$1";; *)printf "%s\n" "$PWD/$1";; es
do_version_check() {
[ "$1" = "$2" ] && return 10
ver1front=`printf $1 | cut -d "." -f -1`
ver1back=`printf $1 | cut -d "." -f 2-`
ver2front=`printf $2 | cut -d "." -f -1`
ver2back=`printf $2 | cut -d "." -f 2-`
ver1front=$(printf "%s" "$1" | cut -d "." -f -1)
ver1back=$(printf "%s" "$1" | cut -d "." -f 2-)
ver2front=$(printf "%s" "$2" | cut -d "." -f -1)
ver2back=$(printf "%s" "$2" | cut -d "." -f 2-)
if [ "$ver1front" != "$1" ] || [ "$ver2front" != "$2" ]; then
[ "$ver1front" -gt "$ver2front" ] && return 11