I have a program that I could run by feeding it some instructions from an input file by redirection. My input file looks like this:
alpha
5
2
run
7
quit
Now, I run it like this:
myprogram < input_file
However, sometimes I need to add some comments to the input file to make it clear, e.g
# The name of value
alpha
# The acceleration
5
# The distance
2
run
7
quit
Unfortunately, now I can't redirect it to the program because It will not ignore the lines starting with #
How can I ignore those comment lines before redirecting it to myprgram
?