From 4356322ee72418cafaeb9d5ad65220201ac0bdd5 Mon Sep 17 00:00:00 2001 From: St33v Date: Thu, 13 May 2021 10:31:26 +1000 Subject: incantation to find comment "#" lines --- grepcomments | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 grepcomments (limited to 'grepcomments') diff --git a/grepcomments b/grepcomments new file mode 100644 index 0000000..e40da26 --- /dev/null +++ b/grepcomments @@ -0,0 +1,14 @@ +#this is a file with comments +#another line +# how do I grep for uncoimmented lines? +try grep -v '^#' +# that works +but grep -nv '^#' is even better +# another comment + +#preceeding line was whitespace +but this is real. + +And now we can exclude whitespace or empty lines: +grep -nvE '^#|^ |^$' grepcomments +#rox -- cgit v1.3