• Scoopta@programming.dev
    link
    fedilink
    arrow-up
    113
    arrow-down
    1
    ·
    4 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
            1
            ·
            16 minutes 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
            3
            ·
            3 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.