[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1019660: console-setup: grep: warning: stray \ before #



Control: tags -1 patch

On 2022-09-13 12:42:11 +0200, Jakub Wilk wrote:
> With grep (>= 3.8), I'm getting this warning:
> 
>   # setupcon
>   grep: warning: stray \ before #

I've attached a patch to fix this issue and other grep usage issues.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Description: Fix setupcon grep usage (for grep 3.8+).
Bug-Debian: https://bugs.debian.org/1019660
Author: Vincent Lefevre <vincent@vinc17.net>
Last-Update: 2022-09-20

--- setupcon~	2022-05-26 22:47:37.000000000 +0200
+++ setupcon	2022-09-20 02:48:26.914726411 +0200
@@ -489,7 +489,7 @@
     for tty in \
         $(cat /etc/inittab /etc/init/* /etc/ttys 2>/dev/null \
 	| grep getty \
-        | egrep '([[:blank:]]|^)tty([1-9][0-9]*|v[0-9a-f])([[:blank:]]|$)' \
+        | grep -E '([[:blank:]]|^)tty([1-9][0-9]*|v[0-9a-f])([[:blank:]]|$)' \
         | sed -e '/^ *#/d' \
               -e 's/.*[[:blank:]]\(tty[1-9][0-9]*\).*/\1/' \
               -e 's/.*[[:blank:]]\(ttyv[0-9a-f]\).*/\1/')
@@ -775,7 +775,7 @@
 esac
 case \
     "`(stty -a \
-          | egrep '(^| )erase *=' \
+          | grep -E '(^| )erase *=' \
           | sed -e 's/.* erase *= *//' -e 's/^erase *= *//' -e 's/[; ].*//') \
       2>/dev/null`"
 in
@@ -1094,8 +1094,8 @@
 # Copyright © 2001 Alcove http://www.alcove.fr/
 if [ "$do_kbd" = linux ]; then
     if [ -x /sbin/sysctl -a -r /etc/sysctl.conf ]; then
-	if grep -v '^\#' /etc/sysctl.conf | grep -q keycodes ; then
-	    grep keycodes /etc/sysctl.conf | grep -v "^#" \
+	if grep -v '^#' /etc/sysctl.conf | grep -q keycodes ; then
+	    grep keycodes /etc/sysctl.conf | grep -v '^#' \
 		| while read -r d ; do
                 /sbin/sysctl -w $d 2> /dev/null || true
             done

Reply to: