HOWTO Trim comments and spaces from files

November 5, 2013

Trim comments and spaces from a file:

$ grep ^[^#] file

“The regex ^[^#] matches the first character of any line, as long as that character that is not a #. Because blank lines don’t have a first character they’re not matched either, resulting in a nice compact output of just the active configuration lines.”

Via David Berner

Make The Call

Get Started

Use this if you’re making an IT decision and want to avoid a costly mistake. Answer four quick questions and we’ll route you to the right next step—strategy, sourcing, contract review, or optimization.

If it’s a fit, you’ll be able to book time immediately.

Start with 4 Quick Questions

Thanks for submitting the form.
By continuing, you agree to be contacted about your request. No spam.