While I understand picking a familiar name, sudo is certainly not the only player, there's also doas. This shows people can adapt to another name and another name would have seemed more appropriate.
edit: whoops, it was already mentioned in this thread [3]
[1] https://daniel.haxx.se/blog/2016/08/19/removing-the-powershe...
The fact that doas has far fewer users, and examples everywhere show `sudo xyz` as the way to run xyz as root, shows that people do not adapt to a different name.
Microsoft has been trying, for years, to get developers to use Windows systems. This is another good step towards doing so.
The answer isn't to use a different name; the answer is to actually support most of the sudo interface.
But that said, there's a subset of the sudo interface that would cover the majority of what most people need on a regular basis:
-H (change home directory)
-i (act like a login shell, which may not be meaningful on Windows but could at least be ignored for compatibility)
-E (preserve the environment)
-u (set the user to something other than root)
-g (set the group)
-s (just run a shell)
The answer is to do either.
i.e. the complaint about using the name while offering a different, incompatible interface is valid.
I do think it was correct to use the name, though, which means they should be more compatible.
Linux users can experience this now by using sed on macOS
> it does the same function which is to elevate a unprivileged command
That's only one of the use cases of Sudo. Here's a description of Sudo from the official manual [1]:
> sudo, sudoedit — execute a command as another user
Sudo for Windows can't do that. It's mentioned in its FAQ:
> the sudo command on Windows does not support running programs as other users
Sudo for Windows is like a cat command that can't concatenate files or a touch command that doesn't update timestamps.
Oh, that's a good counter-example to your own point: 99% of people who use cat don't care about this functionality.
cat *.txt
is a pattern I see being used everywhere.Same goes for sudo. If you're going to claim that a whopping 99% of users don't use the CLI options or /etc/sudoers, you'd need solid proof. Because a simple search shows otherwise:
https://grep.app/search?q=sudo%20-®exp=true
This Sudo for Windows behaves nothing like the actual sudo. It doesn't even achieve the original's stated purpose.
Also considering that search results for anything involving Windows tends to be riddled with spams and outright scams, this will negatively affect non-Windows users searching for sudo as well.
So again, this naming conflict is unfortunate.
That's an astonishing claim to make without evidence. I don't see "cat *" being used anywhere. In fact, I've just ran search for usage of "cat" over the repository of shell scripts that are used for the various packaging and deployment tasks in my company (and we have to deploy a lot of stuff, written in different programming languages, and every team packages their stuff into their docker containers in their own way but it's all still documented in this repo) and every single use of cat is either
a) reading data into a variable "VAR=$(cat file_with_data)";
b) writing inline data from script into a file "cat >>$TARGET_FILE <<EOF ... EOF";
c) an entirely reasonable use of cat "cat file | utility_that_accepts_filenames_too", sometimes even "cat file | utility".
None of them take a pattern or more than one file.
UPD: I've ran "cat *\." on the grep.app, and it seems that it's used mostly for bulk log processing; I vaguely recall we moved away from it to using custom reader scripts because the asterisk doesn't expands into the files ordered the way we needed.
OpenSSL, Curl, Git, Linux, Gettext, NodeJS, zstd, GCC, FFmpeg, OpenJDK, Pyenv
I think users, upstream developers, and downstream packagers of these software will all be upset if cat ceased to concatenate.
Example:
https://sourcegraph.com/search?q=context:global+repo:%5Egith...
UPD: And lots of people use "cat file1 >>output; cat file2 >>output" for concatenation anyhow [0]. Apparently shell already can concatenate things well enough, so cat should do one thing and do it we;l: dump a single file contents to stdout /s.
That's because it's a regex search and not relevant to the point at all. What matters is that people use widely advertised features of a popular tool, including sudo and cat. Especially if that feature is the single stated purpose of the tool.
Taking a name of a widely used tool and slapping it on something that doesn't even do what the original was made for isn't a nice thing to do. I don't get why that's controversial to anyone.
> so cat should do one thing
That one thing is con-"cat"-enating files, so to speak. Why should it become something different just to make the name Sudo for Windows appear somehow less misleading?
Also,
rm out.txt
for f in *.log; do cat "$f" >> out.txt; done
is a clunky way of concatenating files. { for f in *.log; do cat "$f"; done; } | less
Even clunkier.This is off topic, but the Git devs were correct in doing `cat pine patch1 | git am`, since the test in question is
test_expect_success 'am takes patches from a Pine mailbox'
The test requires the mailbox not be split in two, so `git am pine patch1` is out of the question. patch1 is reused across multiple tests, so it makes sense for it to be in separate files. Concatenating is the logical conclusion. cat patch1 >> pine
git am pine
is possible, but why? It's more code and it mutates the contents of files after initial creation, making the tests as a whole slightly harder to reason about.Of course, it being an issue is an opinion (of mine), see my daniel.haxx.se link from my other comment next to yours for a motivation of this opinion.
At a basic level, I’d wager a vast majority of sudo’s usage is very basic, “run this command as admin”. If it can do that out of the box, it solves for a vast majority of users and they don’t have to learn some kind of new cmdlet to be able to do it.
I also can't imagine a different name to cause such a training issue. We are speaking about people who learned using the terminal on Unix and are using it on Windows. They are likely at ease with computers. If they are confused by a name change, I can't imagine how confused they could be at the first difference they encounter. The same name might as well cause more training issues. I'm not convinced.
Now "sudo" is not a very Windows-y name for this utility but it has the advantage of being self-descriptive by those most likely to use it. It's sudo... for Windows. You don't have to explain it further.
The command line namespace is flat and there are only so many letter combinations, the idea that an OS shouldn't reuse a command name from a different OS is pretty limiting.
Good point, the unlikeliness to ever run the real sudo on Windows makes it less an issue. Though doesn't remove it completely. You could for instance imagine a bash script (which you can run on Windows, since you can install Bash there) trying to use sudo if present, or something else, and fail because sudo is present but doesn't have the expected features. In shell land, the name of a command is almost an implicit contract.
> The command line namespace is flat and there are only so many letter combinations, the idea that an OS shouldn't reuse a command name from a different OS is pretty limiting.
In practice:
- Programs are mostly cross platform so many "commands" can work on different OS. Which makes the command line namespace quite shared between OSes
- I've not seen many clashes. I can certainly remember of one: the Chromium browser and the Chromium B.S.U game. It was unintentional. The "sudo" one is. You can certainly avoid it.
It's hard to imagine a company that size would name it so deliberately without realizing it would cause confusion in search engine results and such.
A good faith assumption would be they wanted to make Windows more familiar to users of both but it also means that Windows will get mentioned in more Linux results over time to disambiguate it.
same microsoft as where I'm from?
embrace (copy sudo), extend (add incompatible options), extinguish
Yes, we know. Internet Explorer, yada yada. Beyond the ridiculousness of the notion of sudo specifically being a target for MS, the notion that MS, or any company of its size, is THAT single-minded, is absurd.