#GNU #grep anti patterns that cause #bugs #t2sde #linux #Ads & more @Amazon: https://services.exactcode.de/amzn.cgi?index=electronics&keywords=laptop You can...
Putting aside the “should/shouldn’t do” argument, I was also wondering if the code is even viable. I imagine that ‘ls’ and ‘sudo’ are probably pretty ubiquitous, but I bet there exist some Linux installs out there with a different shell than ‘bash’, and some might not have ‘grep’ too. That would lead to some pretty cryptic bugs for the end user, eh?
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
Putting aside the “should/shouldn’t do” argument, I was also wondering if the code is even viable. I imagine that ‘ls’ and ‘sudo’ are probably pretty ubiquitous, but I bet there exist some Linux installs out there with a different shell than ‘bash’, and some might not have ‘grep’ too. That would lead to some pretty cryptic bugs for the end user, eh?
I might be wrong, but I believe Debian ships without
sudo
, onlysu
by default (or at least if you configure a root password in the setup).You’re right ! And I really should get used to how debian works with
su
.But with docker it’s very convenient to add an user in the docker groupe with sudo :/
I only know because installing
sudo
is usually the very first thing I do whenever I have to install it haha.100%. Alpine is one such distro.
Iirc Void too.
Also, doas instead of sudo
I believe POSIX mandates grep and a shell that should be able to handle everything this code uses, but sudo is a problem
That code is a crime against nature and humanity.
Debian doesn’t come with
sudo
and it’s always annoying running into stuff that has it hardcoded (or just added by default to a command)