Strip comments from a file

Contributor Icon Contributed by skreuzer  
Tag Icon Tagged: UNIX  

This one liner will remove all text after the # character in a file


cat file-with-comments | sed -e 's;#.*;;' -e '/^[ ]*$/d'

 

No Comments -


No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment -