If you want to do only a couple things with the output, filter you source file in a pipeline:
Code:
grep -v '^[[:space:]]*#' /path/to/your/file | your_commands
if you want do extensive stuff with your comment-stripped file, save the stripped file in a temp file, and use use the temp file for the rest of the procedure:
Code:
grep -v '^[[:space:]]*#' /path/to/your/file >/tmp/stripped_source
Note that I use ^[[:space:]]* at the start of the regular expression because lines that are completely comments can still contain leading whitespace. If you want to eliminate blank lines also, do
Code:
egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' /path/to/file >/tmp/stripped_file