mainGNU Core Utilities - Support: sr #106713, wish: a single construct to...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

sr #106713: wish: a single construct to replace "head | tail"

Submitter:  Richard Neill <richardneill>
Submitted:  Thu 09 Apr 2009 05:55:00 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  1 - Wish Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None

Discussion

Fri 24 Sep 2010 08:38:23 PM UTC, comment #1: 

Sounds like a job for SED:
sed -n '15p' FILE

Matthias Bartelt <barteltm>
Thu 09 Apr 2009 05:55:00 AM UTC, original submission:  

I often write things like:
   head -n 15 FILE | tail -n 1
i.e. to extract precisely one line (the 15th here) from the file.

But that's complex, and a waste of a process.

Thus I propose two new options:
   head should gain the option:    -t [NUMBER] 
and
   tail should gain the option:    -h  [NUMBER]

These would mean pipe the output through "{head,tail} -n NUMBER"
respectively. (But this would be done within the single process, rather than actually using a pipe).

So my syntax above becomes:
   head -n 15 -t 1 FILE

Richard Neill <richardneill>

 

Attached Files

This item currently has no attached files.

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by barteltm (Posted a comment)
  • -email is unavailable- added by richardneill (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16-1b88.
    Corresponding source code