You must log in or register to comment.
I don’t code, but is hardcoding sudo EVER a reasonable thing in C?
it is not
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?
That code is a crime against nature and humanity.