LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Dansguardian.config edit using perl or sed (http://www.linuxquestions.org/questions/linux-software-2/dansguardian-config-edit-using-perl-or-sed-899252/)

SlowLearner 08-24-2011 05:28 PM

Dansguardian.config edit using perl or sed
 
DansGuardian Wiki FAQs says:

Quote:

Usage #26. There was a bug in DansGuardian versions 2.9.9.1 through 2.10.0.2 (but not 2.9.9.0 and before, or 2.10.0.3 and after) that caused list lines containing an invisible TAB character to be mis-parsed. That caused all kinds of weird and wonderful behaviors, including what appeared to be the exact same line behaving differently when retyped, and lines being sensitive to the presence of comments! (Use something like dansguardian -v to find out the DansGuardian version, which isn't always the same as the package version.)

To solve the problem do any one of:

Edit the list files to use only SPACEs never TABs.
Convert all existing TABs to the right number of SPACEs (maybe use something like sed or Perl).
Upgrade to at least DansGuardian 2.10.0.3
Since this is only my first miserable attempt at installing a slackbuild and i have zero experience creating my own. Upgrading to DansGuardian 2.10.0.3 seems beyond my ability at the moment. Does anyone on here have the ability to easily "Edit the list files to use only SPACEs never TABs.
Convert all existing TABs to the right number of SPACEs (maybe use something like sed or Perl)"??

Tinkster 08-24-2011 08:51 PM

The question would be: what do they consider to be "the right
number of spaces"?

You could load the file in emacs, for example, and 'untabify',
or vim, if you prefer ;}


With sed (assuming e.g. a standard tab width of 8)
Code:

sed -i 's/\t/        /g' file

grail 08-24-2011 10:49 PM

You could also have a look at the expand command :)


All times are GMT -5. The time now is 01:39 AM.