mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-06-28 07:36:43 +00:00
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:
parent
54202b3b41
commit
f4aab9c8c5
9 changed files with 87 additions and 87 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue