3 ms·
Just continue the pipeline, e.g. ls | map (f: f.size) | red + | map (size: size / 1024) You can also leave off "map", so: ls | (f: f.size) | red + |
by geophile 3y ago
Just continue the pipeline, e.g.
ls | map (f: f.size) | red + | map (size: size / 1024)
You can also leave off "map", so:
ls | (f: f.size) | red + | (size: size / 1024)
A pipeline produces a stream, so there's no clean way to get the single int result in a variable, but you can store the stream (containing the int) into a variable:
ls | ... | (size: size / 1024) >$ x
Now x has the stream. To read back the stream and print it:
x <$
To do something else with the stream:
x <$ (n: n * 1000)
etc.