Skip to content

Commit

Permalink
Double-quote a bash variable to prevent globbing and word splitting
Browse files Browse the repository at this point in the history
The newer version of shell-lint that we are using is now warning about
this.
  • Loading branch information
jsf9k committed Sep 13, 2023
1 parent a98776b commit 08f4244
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bash/.bash_greeter
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ __print_centered_multiline() {
local offset=$2
while IFS= read -r line; do
# Store length
if [ ${#line} -gt $strlen ]; then
if [ ${#line} -gt "$strlen" ]; then
strlen="${#line}"
fi
done <<< "$1"
Expand Down

0 comments on commit 08f4244

Please sign in to comment.