Skip to content

Commit b1078c4

Browse files
committed
ameliorate some shellcheck warnings
1 parent b52ed91 commit b1078c4

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

bin/notify-drift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export MAILTO=root
1616
OUTPUT=/tmp/ansible.daily.$USER.diff
1717

1818
ESC=$'\e'
19-
ANSI_RE="$ESC[[0-9][^m]*m"
20-
ANSI_CYAN="$ESC\\[0;36m" # "include"
21-
ANSI_GREEN="$ESC\\[0;32m" # "ok"
19+
ANSI_RE="$ESC\[[0-9][^m]*m"
20+
ANSI_RE_CYAN="$ESC\\[0;36m" # "include"
21+
ANSI_RE_GREEN="$ESC\\[0;32m" # "ok"
2222

2323
STDOUT=$( mktemp "/tmp/ansible.notify-drift.XXXXXX" ) || exit 1
2424
exec > $STDOUT 2>&1
@@ -29,7 +29,7 @@ exec > $STDOUT 2>&1
2929
normal --check > $OUTPUT.today.tmp 2>&1
3030

3131
#summary_changes=$( grep -e "^${ANSI_RE}changed:" -e "^${ANSI_RE}fatal:" < $OUTPUT.today.tmp )
32-
summary_changes=$( grep "^$ESC" < $OUTPUT.today.tmp | grep -v -e "^$ANSI_GREEN" -e "^$ANSI_CYAN" )
32+
summary_changes=$( grep "^$ESC" < $OUTPUT.today.tmp | grep -v -e "^$ANSI_RE_GREEN" -e "^$ANSI_RE_CYAN" )
3333

3434
(
3535
echo " $OUTPUT"

files/tree/usr/local/bin/bash_error_handler.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env -S echo "This should not be run directly - try using the following command, perhaps configuring \$ERROR_CONTINUE, \$ERROR_PRINT_UNSAFE: \nsource"
2+
# -*- Mode: shell-script -*-
3+
# shellcheck shell=bash
24

35
# source this from your script that wants backtraces from your error
46
# handler:

files/tree/usr/local/bin/bash_trace_handler.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/bin/bash
1+
#!/usr/bin/env -S echo "This should not be run directly - try using the following command, perhaps configuring \$ERROR_CONTINUE, \$ERROR_PRINT_UNSAFE: \nsource"
2+
# -*- Mode: shell-script -*-
3+
# shellcheck shell=bash
24

35
# source this, and you get a nicer 'set -xv' output
46
# https://news.ycombinator.com/item?id=44666984

0 commit comments

Comments
 (0)