On 05/03/21 04:28PM, Greg Reagle wrote:
> Would sbase suck less if the program head, which is currently a C program of 
> 77 lines, were replaced with something like 
>   #!/bin/sh
>   sed "$1"q
> 

Great job.

> I know that it would need to be a bit more elaborate than that to handle the 
> -n flag, but still.  Is there any advantage to having a separate C program?
> 

The spec gets a bit tricky when handling multiple files - see:
seq 3 | awk '{ print $1 > $1 }'
head -n1 $(seq 3)

This is simple enough to do in awk, with very few lines of code.

I'd argue that requiring awk to use `head` would create more
complexity(for the end user) than it would solve for the developer.

Jeremy

Reply via email to