if you want head or tail,
use sed commands to do it and
perhaps alias it by those names,
or make it an executable script.
Remove those from busybox and
relive the true spirit of the day!
interesting idea
looking @ the source
https://git.busybox.net/busybox/tree/coreutils/head.cor even just the usage
busybox head --help
BusyBox v1.29.3 (2018-12-19 15:48:20 UTC) multi-call binary.
Usage: head [OPTIONS] [FILE]...
Print first 10 lines of each FILE (or stdin) to stdout.
With more than one FILE, precede each with a filename header.
-n N[kbm] Print first N lines
-n -N[kbm] Print all except N last lines
-c [-]N[kbm] Print first N bytes
-q Never print headers
-v Always print headers
N may be suffixed by k (x1024), b (x512), or m (x1024^2).
i think if a sh / scripted head was created
using only sed it would be a bit of a merde head script !
for simple cases i guess sed is no problem
but if you intend to replace head.c it might get messy if you want to include ENABLE_FEATURE_FANCY_HEAD functionality
eg
the m/b/k suffixed bytes options parsing
eg: 10k
might well be possible in sed script , my thinking is it would be simpler to write in awk
iv read awk can be used/useful for prototyping code/ideas ... into other lang's
..so it should be possible to transcribe from somotherlang to awk ?
converting human to bytes
imho would be easy in awk ( perhaps if you exclude the option parsing , and passing vars into awk )
and examples exist
all though as with many things i found this can also be scripted with .sh
The origin of the linked post was a book about literate programing so with that in mind
it might be interesting idea to write such a head.sh shell script in markdown
..
with
mdsh Multi-lingual, Markdown-based Literate Programming... in run-anywhere bash
markdown
literate-programming
bash
shell-scripting
scripting-language
if you can tolerate bash as build dependency