TIP_Strip_comments_when_posting_config_files
| Terminals / Shells • Network • X Window System • Portage • System • Filesystems • Kernel • Other |
Contents |
Introduction
It happens very often that people have to post some configuration files in order to get help with a configuration-related problem. Since some configuration files are very long, and contain lots of comments, such posts are really hard to read for other people. So it is good practice to remove all unnecessary comments. This is easily done with one of the following commands:
Commands
sed
sed -e 's/#.*//;/^\s*$/d' <file_name>
grep
egrep -v '(^[ ]*#|^#|^$)' <file_name>
perl
/usr/bin/perl while(<>) { print unless /^(#.+|\s+)$/ );
See Also
Last modified: Sat, 06 Sep 2008 09:10:00 +1000 Hits: 14,750
Created by NickStallman.net, His Dark Materials - The Golden Compass, Luxury Homes Australia
Real estate agents should be using interactive floor plans.
