News for hackers. Stuff that matters.
Re:Show HN: st – simple statistics from the command line by asgeirn on Wednesday September 04, 2013 @08:35AM (#6327045)
Would you be able to use Octave for reading from stdin?
Re:Show HN: st – simple statistics from the command line by nferraz on Wednesday September 04, 2013 @08:43AM (#6327093)
Yes, Sprint suggested this:

    octave -q --eval "mean = mean(load('$1'))"
But, again, octave requires more time to warm up...
Re:Show HN: st – simple statistics from the command line by fluidcruft on Wednesday September 04, 2013 @10:46AM (#6327899)
That does not read the data from stdin. You could probably get it to work with some bash wizardry. But maybe not. I did spend some time on this a few years ago and it may have changed in the interim, but my memory is that I tried load("/dev/stdin") and using a fifo etc and it doesn't work (probably because load() uses some seeks to determine matrix data shape before reading data in i.e. data is read in as columns instead of reading in rows and transposing). At least that was my takeaway. At least if you want to use the load() builtin.

Basically you just need to write an octave function that reads values from the terminal.