On Sat, Aug 27, 2005 at 12:15:53PM -0700, Gary Funck wrote:
Please note from my previous reply:
It turns out that -d and -s don't work well together because
once the character is deleted, it can't be checked for
multiple suppression and translation.
Thus, if 'tr' is our tool of choice that a dual pipeline
is needed:
tr -d '\n' | tr -s '[[:space:]]' ' '
sed, perl, and other tools can likely be coaxed into doing
this in a single step.
I wasn't paying close attention, but I don't follow you here,
Gary. From "man tr":
tr [-c] -ds string1 string2
DESCRIPTION
The tr utility copies the standard input to the standard output with sub-
stitution or deletion of selected characters.
The following options are available:
-c Complements the set of characters in string1, that is -c ab
includes every character except for `a' and `b'.
-d The -d option causes characters to be deleted from the input.
-s The -s option squeezes multiple occurrences of the characters
listed in the last operand (either string1 or string2) in the
^^^^^^^^^^^^^^^^^^^^^^^^^^
input into a single instance of the character. This occurs after
all deletion and translation is completed.
. . . .
In the fourth synopsis form, the characters in string1 are deleted from
the input, and the characters in string2 are compressed as described for
the -s option.
Thus, if the goal is to delete newlines and carriage returns (if
any) and compress all spaces to one, it seems as if Michelle's
version, while apparently still broken, is close.
She had written:
mimedecode |tr -ds '[\n\t\r]' ' '
I would think this should work:
mimedecode | tr -s '[\n\t\r]' ' '
That is, I only removed the "d".
I don't have a "mimedecode" command on this server, so I have to fake it
with something like this to see:
cat nomo.friC | formail -zx Subject: |\
gsed 's/.*[?][bq][?]//I' | base64-decode | tr -s '[\n\t\r]' ' '
But the tr command there works fine.
Dallman
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail