I am trying to complete a script that reads a text file and only includes lines that do not start with a "#" symbol. How would you go about it?
Thanks in advance
Printable View
I am trying to complete a script that reads a text file and only includes lines that do not start with a "#" symbol. How would you go about it?
Thanks in advance
use grep with the -v option and escape the #. For example, if you are catting "test.txt"
this will display all lines within test.txt excluding any that contain a "#".Code:cat test.txt | grep -v \#