Python Forum
i want to make a cli command that ...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i want to make a cli command that ...
#1
i want to make a cli command that does a combination of what head does and what tail does in posix/unix/linux.  with one stdin input stream it will output some of the beginning and some of the end.  it does onot need to implement the -f option or any others which are better done with the real head and tail commands.  this is to get both the beginning and end of a command's output when piped to it.  if one number is given in the options, it should be the number of lines for both the head and the tail.  if two numbers are given in the options, the first is the number of lines for head and the second is the number of lines for tail.  if the content of a short input stream would be in both the head and tail outputs, then the whole input stream is output, with each line just once.

it might take me a while to get to this project, so if someone else wants to do it, instead ... go for it.

Output:
some command | headandtail -4
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
i want to make a cli command that ... - by Skaperen - Sep-28-2017, 03:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  i need to make a command that ... Skaperen 5 2,835 Nov-30-2019, 09:20 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020