News for hackers. Stuff that matters.
Re:Functional programming in sh by geophile on Wednesday May 23, 2012 @09:36PM (#4016303)
Along the same lines: http://geophile.com/osh

Except that instead of bash, it's based on Python. So instead of everything being a string, you have the Python type system. E.g. 50 factorial:

    z@minizack:~$ osh gen 50 1 ^ red '*' $
    30414093201713378043612608166064768844377641568960512000000000000
This red(uce)s using multiplication the stream of integers 1..50.

Find the pids of python processes:

    z@minizack:~$ osh ps ^ select 'p: "python" in p.commandline' ^ f 'p: p.pid' $
    (2094,)
    (2394,)
This pipes process objects from one command to the next. First select the processes whose commandline contains "python", then run a function that maps the process to its pid.
Re:Functional programming in sh by pixelbeat on Thursday May 24, 2012 @05:48AM (#4017609)