]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
lib.sh: escape \b in double quoted string
authorSimon Ruderich <simon@ruderich.org>
Sun, 3 Jun 2018 16:20:05 +0000 (18:20 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 3 Jun 2018 16:21:54 +0000 (18:21 +0200)
Just a warning from shellcheck, but lets fix it.

lib.sh

diff --git a/lib.sh b/lib.sh
index 0329a0f05a4cc85965ca36af9a07b4749ef58f1b..12c9b08a665414e232fb10b343c1989f00312dfd 100644 (file)
--- a/lib.sh
+++ b/lib.sh
@@ -101,7 +101,7 @@ simple_cpp() {
             break
         fi
 
-        cmd="$cmd s/\b$x\b/\$ARGV[\$i]/g; \$i++;"
+        cmd="$cmd s/\\b$x\\b/\$ARGV[\$i]/g; \$i++;"
     done
 
     perl_line_filter "$cmd" -- "$@"