- 2 years
…this is so much more cursed than it needs to be. If you want to bash in C just
system("echo hello world");- 2 years
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 quotes - smeg@feddit.ukEnglish2 years
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.worldEnglish
2 yearsFor 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
- kamen@lemmy.worldEnglish2 years
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.
- 2 years
Always follow best practices, make sure you cleanup by deleting the hello world bash file!
- 2 years
My coworkers could learn a thing or two from this. For one, it actually works.
- 2 years
Okay but 🍒 shouldn’t output 🍉. This is inconsistent and confusing. We have standards.
- 2 years
with open('program.c', 'w') as f: f.write( """I'm not actually going to copy down the program... But you get the idea of the joke. Right?""") - 2 years
Ah yes now I can… dereference a raw pointer (yes that’s essentially the only thing unsafe rust actually enables you to do, it doesn’t disable the borrow checker or anything else, it just allows you to play with pointers)
- 2 years
unsafe fn<'a, T>(p: &'a T) -> &'static mut T { p as *cons T as *mut T as &'static mut T }It is a bit more than just dereferencing raw pointers.
- qaz@lemmy.worldEnglish2 years
Some time ago I wrote a program in COBOL and half of it was just
CALL "SYSTEM" BY CONTENTin the end.- 2 years
I did the same with python once lol.
I didn’t know enoug python or bash so i mixed both with os.system










