How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g.

File name: File.txt

cat File.txt

Result:

#INBOUND_QUEUE=FAQ1          
INBOUND_QUEUE=FAQ2

I want to get the value for one which is not commented out.

Thanks,

Hello Tanu,

Welcome to forums, please use code tags for commands/cods/Inputs as per forum rules. Following may help you in same.

awk '/^#/{next} 1'  Input_file
OR
awk '/^#/{next} 1'  File.txt

Thanks,
R. Singh

Thanks .. Let me try :slight_smile:

---------- Post updated at 07:18 AM ---------- Previous update was at 06:52 AM ----------

Thanks R.Singh for quick response..your solution worked perfectly (y)

grep -v '^#'