💾 Archived View for rawtext.club › ~samhunter › random › 2021-05-21-bash_perversions.gmi captured on 2024-08-18 at 19:31:21. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-05)

🚧 View Differences

-=-=-=-=-=-=-

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