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

Transform your business without wasting money.

We help you identify, audit and implement technology changes within your business to create leverage points to scale your company faster.