Björn@swg-empire.de to Programmer Humor@programming.dev · 9 个月前Pretty straight forwardswg-empire.deimagemessage-square47linkfedilinkarrow-up1736file-text
arrow-up1736imagePretty straight forwardswg-empire.deBjörn@swg-empire.de to Programmer Humor@programming.dev · 9 个月前message-square47linkfedilinkfile-text
minus-squaresmeg@feddit.uklinkfedilinkEnglisharrow-up60·9 个月前Fine, system("bash -c 'echo hello world'"); then!
minus-squareultrafastsloth@lemmy.worldlinkfedilinkarrow-up17·9 个月前I decided to throw my PC in the composter and become a gardener
minus-squareBeanie@programming.devlinkfedilinkarrow-up4·9 个月前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
minus-squaresmeg@feddit.uklinkfedilinkEnglisharrow-up3·9 个月前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.
Fine,
system("bash -c 'echo hello world'");then!Now print “¯\_(ツ)_/¯” with the quotes
I decided to throw my PC in the composter and become a gardener
my best guess:
system("bash -c 'echo \\\"¯\\\\_(ツ)_/¯\\\"'");which will get parsed as:
bash -c 'echo \"¯\\_(ツ)_/¯\"'which will run:
echo "¯\_(ツ)_/¯"and since
echojust prints whatever was given to it, it’ll print"¯\_(ツ)_/¯"with the quotesThat 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.