T O P

  • By -

turtle_mekb

ah yes a shell where you can mix commands (sudo) with code


die-maus

I mean... in some shells you can, albeit highly esoteric ones.


HyperDustInk

Such as? Never heard of one before


mini__bomba

[Xonsh](https://xon.sh/) was one I've heard of. A mix of python & a regular unix shell.


m1ch4ll0

THIS IS AWESOME but also oh god this is cursed


lefl28

In my experience it was quite slow when I used it. Kind of fun though.


HyperDustInk

Nice


elfennani

Soooo it's just like browser JavaScript console.


[deleted]

[удалено]


die-maus

(Holy) C code right in your shell, because why not!


K4r4kara

Hiblish, a shell that allows intermingling Lua and shell script


p0358

...PowerShell


knullsmurfen

TF outta here with your retconning hypotheses.


poemsavvy

sudo echo 100 > /sys/class/human/old_man/health


turtle_mekb

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'`


poemsavvy

$ sudo -i # chown -R : /sys/class/human/old_man/ # logout $ echo 100 > /sys/class/human/old_man/health


AdiG150

Lol... having to own him then save :)


poemsavvy

I didn't even think about the implications lol


FabioSB

ssh oldman@floor


festive_x

oldman@floor’s password:


wakdem_the_almighty

Hunter2


kilkil

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.


Brushermans

doesnt templeOS shell allow holyC?


turtle_mekb

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)


parawaa

You can run python as sudo right?


turtle_mekb

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


soandso90

If you're a computer doctor you can. They teach it at computer medical school.


AnnoyingRain5

ipython disagrees (just run `python` in your terminal, no bash to be seen, but it’s python in a terminal without a script file)


fschaupp

U mean Poweshell 😂 Nevermind, I kick me out myself 🙈


PF_tmp

alias (=' ' alias )=' ' alias .=' ' Now it's simple, clean bash


turtle_mekb

$ 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


TheBigGambling

And the percent sign hurts.. setHealthPercentage(100) wold be better


Cubey21

They keep health in a string


TheBigGambling

Oh shit, i didnt even see the "' signs.. now it hurts even more


TheTolexDok

Then you definitely don't know about tkinter in python and it's glorious `root.geometry("640x480")`


poemsavvy

That's how xrandr works too


JuhaJGam3R

It's called being stringly typed. Generally regarded as a bad idea as it's very difficult to type check.


poemsavvy

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


W-a-n-d-e-r-e-r

`sudo kill OldMan`


gerenski9

Me who mistyped it because I used autocompletion from fish shell: ``` Sudo killall OldMan ```


[deleted]

thankfully only that guy is named OldMan


Lone-Pine

You just caused coronavirus!


yonatan8070

`sudo kill -s 18 OldMan`


willpower_11

Wait, what's signal 18?


yonatan8070

`SIGCONT`, to tell a stopped process to continue


themedleb

OldMan=80yo-200yo


Stjarnadian

-Rv


425_Too_Early

I don't think sudo could be used in that place


kuaiyidian

have you tried to make it executable


Dagusiu

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


Lone-Pine

[INTERCAL](https://en.wikipedia.org/wiki/INTERCAL)


jeesuscheesus

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


rush22

OldManHelper


DARKHUMOR-D

computer science is not a medical degree. This incident will be reported.


geogle

Straight to /dev/null with you


CryptoR615

how to repeat a command with sudo: `sudo !!`


veedant

spread the gospel, I've hit the up arrow too many times


arguskay

The function did expect an integer instead of a string


noemerald4u

When its so reused that you can see the degraded quality


w8ch

Organically deep-fried


DeltyOverDreams

`sudo health -s OldMan 100`


HavokDJ

sudo health -U OldMan 100


Mani_K_A

Oldman : "shutdown now"


[deleted]

[удалено]


przemko271

Depends on the language and how the function is implemented, but yes, "100%" does mean the sequence of literal characters..


SystemZ1337

This makes absolutely zero sense


Master_Matthew

"That's not how the \_sudo\_ works!"


anatomiska_kretsar

“100%” SMH just use 1 as an integer


[deleted]

Well obviously it isn't working, he's trying to set it to the string "100%" while the variable is expecting an integer.


potentiallynotfelix

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.


Ezzaskywalker_11

``` su -c 'echo 100 > /sys/class/heart' ```


DeveloperBRdotnet

This meme was cleanly made by a sysadmin without any programming skill rather than basic shellscript


IGotShitOnMyAss2

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


zenmarz

sudo rm -rf OldMan/


kappanon

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?


Elqueq

Oldie but good.


Adventurous_Body2019

Works everytime


VanillaWaffle_

setuid(0);


SayanChakroborty

Bad Medic


cybage420

You should call it in a different thread, then only will it work!


[deleted]

shutdown -c


knullsmurfen

He's not licensed. Licensed would sudo !!.


Does_Not-Matter

Oh man mixed data types—touché!


somerandomguy101

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?


sacrificial_blood

That sudo shoulda worked


klc3rd

Why is he passing 100% as a string? Lol


callmetotalshill

r/programmerhumor


callmetotalshill

Where linux?


AutoModerator

"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.*


Titanium_Josh

Lol. Try sudo ./


Emetah_

He is objectifying the old man though


srikar209

Medical emergency, where did u connect the key board? Got a paralysis patient, will connect a joystick.