Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Using file lines as "input files"



On Fri, Jul 8, 2022 at 1:58 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
>
> Disclaimer: I _know_ this can be done in seconds with perl /
> python, but I like to not rely on scripting languages when the
> shell can do the job.

This is sort of like saying "I like to not rely on hiking boots when
shoes can do the job."

>   $ chksum Fline1 Fline2 Fline3 ... Fline265000
>
> (Of course without actually splitting the input file

If "not actually splitting" means what it seems to mean, and you
literally want to run cksum, the answer is no.  The things on the
cksum command line have to be file names, so you'd have to create a
file for each line of the original input.

The other option would be to write the CRC algorithm as a shell function.




Messages sorted by: Reverse Date, Date, Thread, Author