Answer the question
In order to leave comments, you need to log in
How can I force the script to ignore lines starting with #?
Hello!
There is a script that does this:
#!/bin/bash
while read line
do
echo "This is a line" $line
done < lines.txt
#This is a line text
#blah blah
line1
line2
#line3
line4 six etc
Answer the question
In order to leave comments, you need to log in
Is it important for you to solve this with a "script"? Your wording solves the problem
grep -v '^#' <filename>
#!/bin/bash
while read line
do
if ; then echo "This is a line" $line; fi
done < lines.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question