GNU bug report logs - #24007
cat: append at specific line, not end of file

Previous Next

Package: coreutils;

Reported by: NAVEEN KUMAR <naveen15690 <at> gmail.com>

Date: Sat, 16 Jul 2016 15:23:02 UTC

Severity: wishlist

Tags: wontfix

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24007 in the body.
You can then email your comments to 24007 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#24007; Package coreutils. (Sat, 16 Jul 2016 15:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to NAVEEN KUMAR <naveen15690 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 16 Jul 2016 15:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: NAVEEN KUMAR <naveen15690 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Report cat bugs to bug-coreutils <at> gnu.org
Date: Sat, 16 Jul 2016 11:41:42 +0530
[Message part 1 (text/plain, inline)]
Hi Team,

Greetings!

I was sitting next my system looking for some basic code brush up and was
playing with CAT command, and though of some kind of additional features to
our existing CAT command, such as...



*"Write a CAT command program, which will allow appending text or lines of
code at user specified line" not only at the end of file.*

*Ex: cat >> filename.c line_number *

Please suggest.

Thanks,
LoveToCode(DreamWalker)
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#24007; Package coreutils. (Sat, 16 Jul 2016 16:40:02 GMT) Full text and rfc822 format available.

Message #8 received at 24007 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: NAVEEN KUMAR <naveen15690 <at> gmail.com>, 24007 <at> debbugs.gnu.org
Subject: Re: bug#24007: Report cat bugs to bug-coreutils <at> gnu.org
Date: Sat, 16 Jul 2016 10:39:48 -0600
[Message part 1 (text/plain, inline)]
tag 24007 notabug
thanks

On 07/16/2016 12:11 AM, NAVEEN KUMAR wrote:
> Hi Team,
> 
> Greetings!
> 
> I was sitting next my system looking for some basic code brush up and was
> playing with CAT command, and though of some kind of additional features to
> our existing CAT command, such as...
> 
> 
> 
> *"Write a CAT command program, which will allow appending text or lines of
> code at user specified line" not only at the end of file.*
> 
> *Ex: cat >> filename.c line_number *

That won't work.  The >> operator in the shell opens a file in
append-only mode, and the operating system enforces that in append mode,
data can only be added at the end, not the middle.

Furthermore, what you suggested can already be done with sed, so there
is no real reason to bloat cat to add non-standard functionality that
can already be done with a standard tool.

sed "$line r $file_to_insert" $file_to_expand

inserts the contents of $file_to_insert starting at line $line of the
file $file_to_expand, and pipes the resulting concatenation to stdout.

These days, it's a very high bar to justify adding new features, and we
prefer to save additions for things that either match other
implementations or that accomplish things more efficiently than what is
possible using only standard tools.  Therefore, I'm closing this feature
suggestion in the bug database as it is unlikely to be implemented, but
do feel free to add further comments on the thread.

Feature suggestions can be sent to coreutils <at> gnu.org, rather than the
bug list, if you are not sure whether it is worth pursuing, so that we
don't clog up the bug database.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 28 Oct 2018 06:27:02 GMT) Full text and rfc822 format available.

Added tag(s) wontfix. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 28 Oct 2018 06:27:02 GMT) Full text and rfc822 format available.

Changed bug title to 'cat: append at specific line, not end of file' from 'Report cat bugs to bug-coreutils <at> gnu.org' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 28 Oct 2018 06:27:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 24007 <at> debbugs.gnu.org and NAVEEN KUMAR <naveen15690 <at> gmail.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 28 Oct 2018 06:27:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.