[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minor 'cat' enhancement w/ patch

From: Tom Warzeka
Subject: minor 'cat' enhancement w/ patch
Date: Sun, 10 Feb 2013 21:56:22 -0500
User-agent: Mozilla/5.0 (X11; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15.1

Hello! I sometimes use 'cat -E' as a quick check for lines with trailing white space. I understand that '$' was chosen as the end-of-line character due to its usage in regular expressions. However, I like to use a more conspicuous character, such as '@'. So, I thought, how about letting the user specify the end-of-line character? While doable with 'sed', it was quite easy to add an option to accomplish this. My proposed new syntax is:

cat -E -c @ ...


cat --show-ends --end-char=@ ...

It is minimally intrusive and does not affect backward compatibility: when one of the new options is not specified, the end-of-line character is still '$'. Alternatively, use of one of these options could automatically turn-on displaying an end-of-line character
(just add "show_ends = true;" within the new case).

Here's my patch submitted for your perusal. It is applied to coreutils-8.20, the current latest stable release. If you decide to include it, feel free to make any changes you see fit. Thanks!

-- Tom

Attachment: cat-coreutils-8.20.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]