• Peruvian_Skies@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 days ago

      There aren’t any square brackets.

      The form “function(){content}” in bash defines a function called “function” that, when called by name, executes “content”. This forkbomb defines a function called : (just a colon) which calls itself twice in a new subprocess (the two colons inside the curly brackets). It thus spawns more and more copies of itself until it overwhelms your processor.

      • baduhai@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        2 days ago

        I understood, it’s just that @Delta_V@lemmy.world added square brackets to his explanation.

        { [:|:&] } — the function's body:

    • Delta_V@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 days ago

      because I didn’t know what it did either, then made a typo in the ChatGPT prompt when asking about it