SMOLNET PORTAL home about changes

Bigger scheme - sam's capsule: Bash perversions

           /       \       /
    k --- a         b --- f
   /       \       /       \
           me --- l         i
   \       /       \       /
    j --- c         d --- e
           \       /
            g --- h


While trying to invent (reinvent?) a virtual fuse of sorts for one of my systems I managed to create the following monstrosity... it works without writing to disk, so I'll probably use it... It reloads from 'foos' file located in your $HOME. If you put it elsewhere -- change the filename in the last line accordingly.

  ## $HOME/foos ###
  # source it, then run 'foo' repeatedly.
  foo() {
    echo "##########"; foo() {
      echo "#########"; foo() {
        echo "########"; foo() {
          echo "#######"; foo() {
            echo "######"; foo() {
              echo "#####"; foo(){
                echo "####"; foo() {
                  echo "###"; foo() {
                    echo "##"; foo() {
                      echo "#"; echo "Boom"
                      . ~/foos; } } } } } } } } } }
  ### EOF ###


... and while I am at "Lispy" contraptions - a recursive 'seq', counting backwards...


  ## bes ##
  # source it, run "qes" or "qes 30" or "qes $LINES"
  qes() {
    local A
    A=${1:-10}
    echo $A
    [ $A -gt 1 ] || return 0
    ((A--))
    qes $A
  }


Isn't Bash wonderful? ;-)

//samhunter
^D

Back
Response: 20 (Success), text/gemini
Original URLgemini://rawtext.club/~samhunter/random/2021-05-21-bash_p...
Status Code20 (Success)
Content-Typetext/gemini; charset=utf-8; lang=en