[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sed : Possible error in example scripts
From: |
Miguel Gutiérrez |
Subject: |
sed : Possible error in example scripts |
Date: |
Fri, 2 May 2014 00:10:58 -0400 |
Good evening,
First of all thank you for your work, as a student your OS allowed me to
graduate without having to pay for software, it would have been much harder
for me to do it with Windows.
I was practising with the example scripts given in the documentation of
version 4.2.1 of GNU sed, and did not have any troubles except with section
4.17 on squeezing blank lines. In my computer, I found inconsistencies
between the three versions (they do not behave the same way when applied to
the same test file) on the one hand, and I found that they differ from the
output of 'cat -s' on the other hand.
About the differences with 'cat -s', either there are differences at top
file (T), at bottom (B) or in between (M). The following is a summary of
the differences found for three test files:
testfile3 testfile4 testfile5
original script 1: M T TB
original script 2: MB T TB
original script 3: MB M OK
In the majority of cases, the difference comes from the treatment of
leading and trailing blank lines, since the scripts tend to delete them
all, which is not the 'cat -s' behavior. But I think there are also
conceptual errors, since a script introduces blank lines that were not
present originally.
In order to document those differences, I send along a zip file which
contains:
- three test files
- the original scripts
- modified scripts that work with the test files (with comments)
- a sample output
I hope this helps.
Best regards,
--
Miguel Gutiérrez Álvarez
Ingeniero Civil Industrial
Universidad de Chile
Cel.: (09) 7 748 2087
04_17_squeeze_blank_lines.zip
Description: Zip archive
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- sed : Possible error in example scripts,
Miguel Gutiérrez <=