mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-07-25 20:27:49 +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
|
@ -1,3 +1,4 @@
|
|||
#!/bin/sh
|
||||
bldred='\033[1;31m'
|
||||
bldgrn='\033[1;32m'
|
||||
bldblu='\033[1;34m'
|
||||
|
@ -5,21 +6,21 @@ bldylw='\033[1;33m' # Yellow
|
|||
txtrst='\033[0m'
|
||||
|
||||
logit () {
|
||||
printf "$1\n" | tee -a $logger
|
||||
printf "%b\n" "$1" | tee -a "$logger"
|
||||
}
|
||||
|
||||
info () {
|
||||
printf '%b' "${bldblu}[INFO]${txtrst} $1\n" | tee -a $logger
|
||||
printf "%b\n" "${bldblu}[INFO]${txtrst} $1" | tee -a "$logger"
|
||||
}
|
||||
|
||||
pass () {
|
||||
printf '%b' "${bldgrn}[PASS]${txtrst} $1\n" | tee -a $logger
|
||||
printf "%b\n" "${bldgrn}[PASS]${txtrst} $1" | tee -a "$logger"
|
||||
}
|
||||
|
||||
warn () {
|
||||
printf '%b' "${bldred}[WARN]${txtrst} $1\n" | tee -a $logger
|
||||
printf "%b\n" "${bldred}[WARN]${txtrst} $1" | tee -a "$logger"
|
||||
}
|
||||
|
||||
yell () {
|
||||
printf '%b' "${bldylw}$1${txtrst}\n"
|
||||
printf "%b\n" "${bldylw}$1${txtrst}\n"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue