• Scoopta@programming.dev
    link
    fedilink
    arrow-up
    108
    arrow-down
    1
    ·
    10 days ago

    …this is so much more cursed than it needs to be. If you want to bash in C just system("echo hello world");

          • Beanie@programming.dev
            link
            fedilink
            arrow-up
            3
            ·
            6 days ago

            my best guess: system("bash -c 'echo \\\"¯\\\\_(ツ)_/¯\\\"'");

            which will get parsed as: bash -c 'echo \\\_(ツ)_/¯\"'

            which will run: echo "¯\_(ツ)_/¯"

            and since echo just prints whatever was given to it, it’ll print "¯\_(ツ)_/¯" with the quotes

          • smeg@feddit.uk
            link
            fedilink
            English
            arrow-up
            2
            ·
            9 days ago

            That was actually the first line of C I’ve ever written so there’s no way I’m guessing the right number of escapes, but I guess I’d cheat by finding the value of each char and printing those one at a time.

  • DreamButt@lemmy.world
    link
    fedilink
    English
    arrow-up
    39
    ·
    10 days ago

    For shame. They forgot to make a script to make a tmp script using mktmp, so they can store their tmp script in the tmp script and have proper cleanup

  • Artyom@lemm.ee
    link
    fedilink
    arrow-up
    33
    ·
    10 days ago

    Always follow best practices, make sure you cleanup by deleting the hello world bash file!

        • kamen@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          arrow-down
          5
          ·
          9 days ago

          Laugh tracks have a purpose though. I understand they’re not to everyone’s liking - and that’s fine, but they work for some comedy shows - and usually they’re from the live audience that sees things performed in front of them.

  • qaz@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    9 days ago

    Some time ago I wrote a program in COBOL and half of it was just CALL "SYSTEM" BY CONTENT in the end.

  • pedz@lemmy.ca
    link
    fedilink
    arrow-up
    2
    ·
    9 days ago

    That’s me with TCL.

    I’ve had an eggdrop for years (obviously) and I’m very bad with TCL, so any new script that I want to add is a bash script executed by the TCL script.

      • pedz@lemmy.ca
        link
        fedilink
        arrow-up
        2
        ·
        9 days ago

        I still have an IRC server but the eggdrop’s usefulness has pretty much been reduced to fetching YouTube titles and the URL of images on tenor. Its main use was to fetch titles for all URLs pasted on channels where it is, but because me and most of the users are now using TheLounge as a client, there is no need for that anymore, except for a few exceptions. At one point it was also displaying all the things my friends upvoted on reddit, but since reddit closed its API and I came here…

        IRC with TheLounge is still very useful though.

  • sga@lemmings.world
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    10 days ago

    reinventing shell scripting. Though I am guilty of this, I do something like this (more complex) but essentially a shell script in rust just because for some application, reading files is slower that way