This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
computing:linux:strip_comments [2012/03/29 10:48] gcooper created |
computing:linux:strip_comments [2015/10/19 10:00] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Strip Comments ====== | ====== Strip Comments ====== | ||
- | Create this tiny shell script and use it to view configuration files at their smallest and most readable form. | + | ===== With '' |
- | + | ||
- | Many support organizations insist you strip comments from config files to make them more readable. | + | |
< | < | ||
- | vi / | + | grep -v ' |
</ | </ | ||
- | Then add the contents: | + | ===== Small Utility ===== |
+ | |||
+ | FIXME | ||
+ | |||
+ | Create this tiny utility to view configuration files at their smallest and most readable form. | ||
+ | |||
+ | Many support organizations insist you strip comments from config files to make them more readable. | ||
+ | |||
+ | Create, install and make the utility executable (cut and paste the following at the command line as root): | ||
< | < | ||
+ | cat << EOF >> / | ||
#!/bin/sh | #!/bin/sh | ||
+ | # ' | ||
+ | # It's not perfect and may not work for you. Note that it strips the initial "# | ||
+ | # | ||
echo "" | echo "" | ||
- | cat $1 | sed -e '/ | + | cat \$1 | sed -e '/ |
- | </file> | + | EOF |
- | You should make the file executable: | ||
- | |||
- | < | ||
chmod +x / | chmod +x / | ||
</ | </ |