summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSt33v <github@f3rr3t.com>2021-05-13 10:31:26 +1000
committerSt33v <github@f3rr3t.com>2021-05-13 10:31:26 +1000
commit4356322ee72418cafaeb9d5ad65220201ac0bdd5 (patch)
tree7bf5a847ee555cf36b750b35afd10d32596f48aa
parent8875c2cfcd54f1b3d3b436b81f1ba05928d69681 (diff)
incantation to find comment "#" lines
-rw-r--r--grepcomments14
1 files changed, 14 insertions, 0 deletions
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 '^#' <file>
+# that works
+but grep -nv '^#' <file> 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