>
>John,
>
> There's a simpler way... (perl is, typically, overkill.)
>To strip the blanks from a file, just use "sed":
>
>        cat $file | sed "s/ *$//" > /tmp/strip.$$
>        mv /tmp/strip.$$ $file
>
>This cats the file named "$file" - strips the blanks and writes
>the output in the file named /tmp/strip.$$.  Then, it moves
>the file named strip.$$ back over the original file.
[snip]

A nominee for the "Useless use of cat" award:

        cat $file | sed "s/ *$//" > /tmp/strip.$$

vs.:

        sed "s/ *$//" < $file > /tmp/strip.$$

:)

Reply via email to