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

Re: Using file lines as "input files"



On 7/8/22, Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> So, would it be possible to pass each line in "$INFILE" as a file
> argument to "cksum", i.e.
>
>   $ chksum Fline1 Fline2 Fline3 ... Fline265000

Assuming that the above command works, you should be able to do
% cksum ${(f)"$(<$INFILE)"}

Depending on your kernel this may be too long of a command line, you
can use zargs (or xargs) to work around that if needed, or if you're
on Linux you may be able to increase your stack size with ulimit -s,
eg
% ulimit -s 132768
(my default is 8192 which is not enough for the given example)

-- 
Mikael Magnusson




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