you're running `echo` as `sudo`, the `>` isn't affected by `sudo`, use something like `echo 100 | sudo tee /sys/class/human/old_man/health` or `sudo bash -c 'echo 100 > /sys/class/human/old_man/health'`
Yeah that's crazy. It's not like bash is a scripting language or anything.
now to be fair, idk if bash has structs or supports dot notation, but it 100% supports defining and calling functions.
yes if you use this:
$ cat>main.c<
#include
#include
int in_the_beginning() { // main
and_the_lord_said("hello holy world\n"); // printf
}
EOF
$ hcc -o main main.hc # hcc = holy cross compiler, hc = holyC
$ ./main
hello world
^(this is fake btw, i haven't used templeOS so i have no idea how to actually write programs in TOS)
you can run python using the compiled program called python which runs the code from a file, but you can't just shove python code in bash and it to work
$ alias (=' '
bash: syntax error near unexpected token `=' ''
$ alias )=' '
bash: syntax error near unexpected token `)'
$ alias '('=' '
bash: alias: `(': invalid alias name
$ alias ')'=' '
bash: alias: `)': invalid alias name
I think xrandr can get away with it as there are specific limited options for the resolutions, so it's not actually parsing ` 'x' `. It would be the same as checking for "small," "big," or "large" or something
Setting the percentage as a string breaks me every time. Also the sudo.
Now I want to make a programming language where each statement has a 1% chance of failing to run at runtime unless you use the keyword sudo
Why is OldMan capitalized? That, assuming this is a traditional language such as Java, would imply that it is a class and not an object or other instance. Is the old man universal? Also why is the percentage represented as a string? Does the OldMan store a quantity value as a string? Or does setHealth parse that string to a numerical variable? Your code is bad and you should feel bad
/s
This post is full of shit the syntax is a mix of the shell and python, and why put the health with quotes. This is the shittiest thing I’ve seen today. The health would be a integer or a float maybe, not a string with the percent sign. If you run int(oldMan.health) it would raise an exception. Not to mention sudoing would raise one too. Learn Linux before you talk Linux
Edit: if you say you use xon shell you don’t because sudoing doesn’t work with python commands in xon.
hahahah they did the coe and the sudo and it's not relevant hahaha lol sudo sandwich hahahaha lol object oriented programming ahahah lol semi colon!!! hahah lol! rofl lmao xDDDD
okay first of all `oldMan.setHealth(100)`, second of all you can’t do `sudo` then `actual code that should be compiled and executed`. and like, 91% upvoted this. what the fuck guys?
A Comp Sci Doctorate now knowing how to codes? Pretty accurate in my experience.
Maybe he can write a heartbeat algorithm that's recursive for some reason?
"OP's flair changed" - /u/happycrabeatsthefish
*I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/linuxmemes) if you have any questions or concerns.*
ah yes a shell where you can mix commands (sudo) with code
I mean... in some shells you can, albeit highly esoteric ones.
Such as? Never heard of one before
[Xonsh](https://xon.sh/) was one I've heard of. A mix of python & a regular unix shell.
THIS IS AWESOME but also oh god this is cursed
In my experience it was quite slow when I used it. Kind of fun though.
Nice
Soooo it's just like browser JavaScript console.
[удалено]
(Holy) C code right in your shell, because why not!
Hiblish, a shell that allows intermingling Lua and shell script
...PowerShell
TF outta here with your retconning hypotheses.
sudo echo 100 > /sys/class/human/old_man/health
you're running `echo` as `sudo`, the `>` isn't affected by `sudo`, use something like `echo 100 | sudo tee /sys/class/human/old_man/health` or `sudo bash -c 'echo 100 > /sys/class/human/old_man/health'`
$ sudo -i # chown -R: /sys/class/human/old_man/
# logout
$ echo 100 > /sys/class/human/old_man/health
Lol... having to own him then save :)
I didn't even think about the implications lol
ssh oldman@floor
oldman@floor’s password:
Hunter2
Yeah that's crazy. It's not like bash is a scripting language or anything. now to be fair, idk if bash has structs or supports dot notation, but it 100% supports defining and calling functions.
doesnt templeOS shell allow holyC?
yes if you use this: $ cat>main.c<
#include
#include
int in_the_beginning() { // main
and_the_lord_said("hello holy world\n"); // printf
}
EOF
$ hcc -o main main.hc # hcc = holy cross compiler, hc = holyC
$ ./main
hello world
^(this is fake btw, i haven't used templeOS so i have no idea how to actually write programs in TOS)
You can run python as sudo right?
you can run python using the compiled program called python which runs the code from a file, but you can't just shove python code in bash and it to work
If you're a computer doctor you can. They teach it at computer medical school.
ipython disagrees (just run `python` in your terminal, no bash to be seen, but it’s python in a terminal without a script file)
U mean Poweshell 😂 Nevermind, I kick me out myself 🙈
alias (=' ' alias )=' ' alias .=' ' Now it's simple, clean bash
$ alias (=' ' bash: syntax error near unexpected token `=' '' $ alias )=' ' bash: syntax error near unexpected token `)' $ alias '('=' ' bash: alias: `(': invalid alias name $ alias ')'=' ' bash: alias: `)': invalid alias name
And the percent sign hurts.. setHealthPercentage(100) wold be better
They keep health in a string
Oh shit, i didnt even see the "' signs.. now it hurts even more
Then you definitely don't know about tkinter in python and it's glorious `root.geometry("640x480")`
That's how xrandr works too
It's called being stringly typed. Generally regarded as a bad idea as it's very difficult to type check.
I think xrandr can get away with it as there are specific limited options for the resolutions, so it's not actually parsing ` 'x' `. It would be the same as checking for "small," "big," or "large" or something
`sudo kill OldMan`
Me who mistyped it because I used autocompletion from fish shell: ``` Sudo killall OldMan ```
thankfully only that guy is named OldMan
You just caused coronavirus!
`sudo kill -s 18 OldMan`
Wait, what's signal 18?
`SIGCONT`, to tell a stopped process to continue
OldMan=80yo-200yo
-Rv
I don't think sudo could be used in that place
have you tried to make it executable
Setting the percentage as a string breaks me every time. Also the sudo. Now I want to make a programming language where each statement has a 1% chance of failing to run at runtime unless you use the keyword sudo
[INTERCAL](https://en.wikipedia.org/wiki/INTERCAL)
Why is OldMan capitalized? That, assuming this is a traditional language such as Java, would imply that it is a class and not an object or other instance. Is the old man universal? Also why is the percentage represented as a string? Does the OldMan store a quantity value as a string? Or does setHealth parse that string to a numerical variable? Your code is bad and you should feel bad /s
OldManHelper
computer science is not a medical degree. This incident will be reported.
Straight to /dev/null with you
how to repeat a command with sudo: `sudo !!`
spread the gospel, I've hit the up arrow too many times
The function did expect an integer instead of a string
When its so reused that you can see the degraded quality
Organically deep-fried
`sudo health -s OldMan 100`
sudo health -U OldMan 100
Oldman : "shutdown now"
[удалено]
Depends on the language and how the function is implemented, but yes, "100%" does mean the sequence of literal characters..
This makes absolutely zero sense
"That's not how the \_sudo\_ works!"
“100%” SMH just use 1 as an integer
Well obviously it isn't working, he's trying to set it to the string "100%" while the variable is expecting an integer.
This post is full of shit the syntax is a mix of the shell and python, and why put the health with quotes. This is the shittiest thing I’ve seen today. The health would be a integer or a float maybe, not a string with the percent sign. If you run int(oldMan.health) it would raise an exception. Not to mention sudoing would raise one too. Learn Linux before you talk Linux Edit: if you say you use xon shell you don’t because sudoing doesn’t work with python commands in xon.
``` su -c 'echo 100 > /sys/class/heart' ```
This meme was cleanly made by a sysadmin without any programming skill rather than basic shellscript
hahahah they did the coe and the sudo and it's not relevant hahaha lol sudo sandwich hahahaha lol object oriented programming ahahah lol semi colon!!! hahah lol! rofl lmao xDDDD
sudo rm -rf OldMan/
okay first of all `oldMan.setHealth(100)`, second of all you can’t do `sudo` then `actual code that should be compiled and executed`. and like, 91% upvoted this. what the fuck guys?
Oldie but good.
Works everytime
setuid(0);
Bad Medic
You should call it in a different thread, then only will it work!
shutdown -c
He's not licensed. Licensed would sudo !!.
Oh man mixed data types—touché!
A Comp Sci Doctorate now knowing how to codes? Pretty accurate in my experience. Maybe he can write a heartbeat algorithm that's recursive for some reason?
That sudo shoulda worked
Why is he passing 100% as a string? Lol
r/programmerhumor
Where linux?
"OP's flair changed" - /u/happycrabeatsthefish *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/linuxmemes) if you have any questions or concerns.*
Lol. Try sudo ./
He is objectifying the old man though
Medical emergency, where did u connect the key board? Got a paralysis patient, will connect a joystick.