diff options
author | Brian Behlendorf <[email protected]> | 2018-01-17 10:17:16 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2018-01-17 10:17:16 -0800 |
commit | 3da3488e6339ff2dc5c7f3da8c8a0c552d018d68 (patch) | |
tree | acf9843a79221a7fa9de852507d3cdef8772ee44 /cmd/zed/zed.d/zed-functions.sh | |
parent | d658b2caa95726c13d99123874910cdedc7ce866 (diff) |
Fix shellcheck v0.4.6 warnings
Resolve new warnings reported after upgrading to shellcheck
version 0.4.6. This patch contains no functional changes.
* egrep is non-standard and deprecated. Use grep -E instead. [SC2196]
* Check exit code directly with e.g. 'if mycmd;', not indirectly
with $?. [SC2181] Suppressed.
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #7040
Diffstat (limited to 'cmd/zed/zed.d/zed-functions.sh')
-rw-r--r-- | cmd/zed/zed.d/zed-functions.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/zed/zed.d/zed-functions.sh b/cmd/zed/zed.d/zed-functions.sh index b7de5104f..ed6a95914 100644 --- a/cmd/zed/zed.d/zed-functions.sh +++ b/cmd/zed/zed.d/zed-functions.sh @@ -397,7 +397,7 @@ zed_rate_limit() zed_lock "${lockfile}" "${lockfile_fd}" time_now="$(date +%s)" - time_prev="$(egrep "^[0-9]+;${tag}\$" "${statefile}" 2>/dev/null \ + time_prev="$(grep -E "^[0-9]+;${tag}\$" "${statefile}" 2>/dev/null \ | tail -1 | cut -d\; -f1)" if [ -n "${time_prev}" ] \ @@ -406,7 +406,7 @@ zed_rate_limit() else umask_bak="$(umask)" umask 077 - egrep -v "^[0-9]+;${tag}\$" "${statefile}" 2>/dev/null \ + grep -E -v "^[0-9]+;${tag}\$" "${statefile}" 2>/dev/null \ > "${statefile}.$$" echo "${time_now};${tag}" >> "${statefile}.$$" mv -f "${statefile}.$$" "${statefile}" |