Bash functions are better than I thought
Here&#x27;s an interesting bit of...abuse :) Since Bash is effectively stringly-typed, it can be used as a functional programming language, with pipes similar to function composition.<p>e.g.: wtfp.sh<p><pre><code>    #!&#x2F;usr&#x2F;bin&#x2F;env bash

    map() {
      local fn=&quot;$1&quot;

      local input
      while read -r input; do
        &quot;${fn}&quot; &quot;${input}&quot;
      done
    }

    reduce() {
      local fn=&quot;$1&quot;
      local init=&quot;$2&quot;

      local input
      local output=&quot;${init}&quot;

      while read -r input; do
        output=&quot;$(&quot;${fn}&quot; &quot;${output}&quot; &quot;${input}&quot;)&quot;
      done

      echo &quot;${output}&quot;
    }

    filter() {
      local fn=&quot;$1&quot;

      local input
      while read -r input; do
        &quot;${fn}&quot; &quot;${input}&quot; &amp;&amp; echo &quot;${input}&quot;
      done
    }

    add() {
      echo $(( $1 + $2 ))
    }

    increment() {
      echo $(( $1 + 1 ))
    }

    square() {
      echo $(( $1 * $1 ))
    }

    even() {
      return $(( $1 % 2 ))
    }

    sum() {
      reduce add 0
    }

    map increment | map square | filter even | sum
</code></pre>
...then:<p><pre><code>    $ printf &quot;%s\n&quot; 1 2 3 4 5 | .&#x2F;wtfp.sh
    56</code></pre>