News for hackers. Stuff that matters.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by wyldfire on Friday August 19, 2016 @09:17AM (#12319721)
And in what is starting to seem like a pattern, Microsoft makes a public move to do the Right Thing.

>jpsnover commented ... @bagder You bring up a great point. We added a number of aliases for Unix commands but if someone has installed those commands on WIndows, those aliases screw them up. ... We need to fix this.

> Snover is a Technical Fellow at Microsoft & the inventor of Windows PowerShell ...

The thread goes on at length about bureaucratic requirements for the change. I guess this is what happens when you hold a bazaar inside the cathedral.

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by akerro on Friday August 19, 2016 @09:26AM (#12319775)
I find this comment most important in all discussion:

>To be honest, I don't see how this dscussion about how many people might depend on these aliases is relevant. The story as I see it is that a few years ago you decided to usurp the names of some well known tools, in the full knowledge that doing so would break those tools. You have then ignored bug reports about this for years. You really can't deny that you knew a long time ago that what you did amounted to hostile behaviour towards other people.

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by kyberias on Friday August 19, 2016 @09:33AM (#12319822)
How is that comment useful? No-one is denying anything. It's obvious that the decision to implement those aliases was incorrect. It's not like Microsoft is saying that it was correct.

It's not a question of who was right or who to blame. It's a question of how to make the changes because there _are_ users that depend on those aliases.

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by emodendroket on Friday August 19, 2016 @10:01AM (#12320028)
They are also honestly pretty useful as a new user. `ls` and `dir` are more obvious things to try than `Get-ChildItem`.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by Spivak on Friday August 19, 2016 @10:18AM (#12320151)
The half-way solution could have been making the 'aliases' output migration documentation about how to accomplish common takes with the PS commands.

That way PS would be far more discoverable to a UNIX person and would save time searching "$command in powershell".

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by emodendroket on Friday August 19, 2016 @11:41AM (#12320828)
Yeah but frankly it also sucks to type in such a long command rather than using the aliases.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by contextfree on Friday August 19, 2016 @02:17PM (#12322139)
Most of the commands have PS "native" aliases which also follow a more consistent pattern, e.g., get-childitem->gci, invoke-webrequest->iwr.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by emodendroket on Friday August 19, 2016 @02:31PM (#12322276)
That's true, but after years of typing "ls" into terminals that's just more natural.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by kuschku on Friday August 19, 2016 @10:08AM (#12320092)
Then maybe design new ones?

"download" aka "dl" instead of curl/wget?

"list" instead of ls/dir?

Would also make them easier googleable

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by Eyas on Friday August 19, 2016 @11:46AM (#12320867)
That's not the problem MS was trying to fix with the Linux aliases -- the problem they were trying to fix was ergonomics. A lot of us are used to Linux commands and are turned off by Windows shells when we have to learn a new set of commands and can't use `ls`.

In fact, being able to do `ls` rather than `dir` on PowerShell was one big reason I gave it a chance. My other Windows shell experiences have been supremely intolerable because of that.

With curl and wget, Microsoft admits they were overeager.

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by kstrauser on Friday August 19, 2016 @12:15PM (#12321109)
I think the correct ergonomics would be if you saw:

  $ curl http://example.com/foo
  Fetching http://example.com/foo by emulating curl
  This command is an alias for "...".
  If you've installed a real curl command, disable this by typing...
so that you could still use muscle memory to type the commands you know, could see what the actual underlying command is so you could adapt to it, and would know how to use the Real Thing if you have it.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by emodendroket on Friday August 19, 2016 @12:45PM (#12321383)
Kind of noisy, isn't it?
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by kstrauser on Friday August 19, 2016 @01:19PM (#12321654)
It is, but the noise is telling you how it differs from what you'd normally expect and how to address it. I think that's an acceptable tradeoff.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by emodendroket on Friday August 19, 2016 @01:36PM (#12321803)
I think it is immediately obvious from the output that it's not the same program, without the message.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by kstrauser on Friday August 19, 2016 @03:03PM (#12322615)
Really? What's the normal output? The content of the URL being fetched. If that message was to STDERR so that curl > foo worked without alteration but the help text still showed up on the console, I think fewer people would be surprised.

The number of bugs about this indicates that people are still being surprised.

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by emodendroket on Friday August 19, 2016 @03:36PM (#12322873)
That is not the output of the PoSh command. Like most of them it outputs a list of object properties and values: https://mcpmag.com/articles/2013/01/22/~/media/ECG/mcpmag/Im...
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by FLGMwt on Friday August 19, 2016 @10:20AM (#12320163)
PowerShell has other ones in addition to the cannibalistic ones. `Get-ChildItem` has `gci` and the command in question, `Invoke-WebRequest` has `iwr` on top of `wget` and `curl`. Admittedly, it's pretty kitchen sinky.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by kuschku on Friday August 19, 2016 @11:29AM (#12320710)
So, there’s already a solution.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by emodendroket on Friday August 19, 2016 @11:42AM (#12320832)
Those are not discoverable in the same way.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by yread on Friday August 19, 2016 @11:52AM (#12320914)
I think this comment is important in understanding why so much open source software doesn't have backwards compatibility

> If removing these aliases (retroactively, if you want to clean up your act you have to remove this from all versions in which this was ever released) breaks things for some people, then you can go and send people out to help them fix their issues. You knew it was a hostile action, you broke things, you fix them.

retroactively remove things from old versions? This is crazy

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by firethief on Friday August 19, 2016 @12:23PM (#12321177)
No one does that. How is this comment from someone who doesn't understand the "release" concept so important?
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by JeffreySnover on Friday August 19, 2016 @01:36PM (#12321801)
When I had no customers - I had lots of flexibility.

PowerShell is now installed on many hundreds of millions of machines.

With great success comes great responsibility.

We can and will change things but we have to do so in a thoughtful manner.

Jeffrey Snover [MSFT]

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by patrickaljord on Friday August 19, 2016 @09:25AM (#12319772)
Kind of worrying that the inventor of PowerShell could make such a mistake. Reminds be of when rvm used an alias for "cd", which was even worse. Making up alias for popular tools such as cd, curl or wget is always a bad idea both for security and practical reasons since it breaks many tools in non-obvious ways and can be hijacked etc. It's great though that it's being fixed.

I installed PS on my ubuntu last night, it works but I don't really see the point in using it on anything but windows. Last thing I need is worry whether my scripts will run on my custom shell script as if running ubuntu didn't come with its own issues to worry about already.

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by amyjess on Friday August 19, 2016 @09:47AM (#12319917)
> Making up alias for popular tools such as cd

cd is a shell builtin on every single *nix shell, not an independent tool. Every shell has its own cd implementation.

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by dTal on Friday August 19, 2016 @10:25AM (#12320207)
You might also add that it's actually impossible to implement cd as a standalone tool - processes cannot change their parent's working directory.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by richardwhiuk on Friday August 19, 2016 @10:51AM (#12320395)
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by dTal on Saturday August 20, 2016 @10:24AM (#12326728)
Well how about that. Serve me right calling something "impossible".

Now what do I say? "Impossible without awful hackery"?

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by iaskwhy on Friday August 19, 2016 @10:58AM (#12320462)
Are other commands also different from shell to shell? It seems like an interesting point, if true.
Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by kemayo on Friday August 19, 2016 @11:38AM (#12320792)
Lots of simple shell functionality is provided as builtins. See the bash manual for a list of builtins inherited from the Bourne Shell[1] and that are bash-specific[2].

Note that some of these are part of the POSIX standard, so there's not a huge amount of variance allowed between shells which are being compliant. Obviously, PowerShell doesn't adhere to this.

[1] https://www.gnu.org/software/bash/manual/html_node/Bourne-Sh...

[2]: https://www.gnu.org/software/bash/manual/html_node/Bash-Buil...

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by snuxoll on Friday August 19, 2016 @11:34AM (#12320752)
Here's a couple of pages listing the builtins in bash: https://www.gnu.org/software/bash/manual/html_node/Shell-Bui...

And zsh: http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Command...

Powershell doesn't really have "builtins" per-se, every cmdlet is executed in the process of the shell itself but they're all contained within loadable modules (though 2-3 modules are loaded with the shell startup by default), Invoke-WebRequest is contained within Microsoft.PowerShell.Utility for example.

Re:Curl author asks Microsoft to remove 'curl' and 'wget' al... by pcwalton on Friday August 19, 2016 @12:03PM (#12321002)
> The thread goes on at length about bureaucratic requirements for the change.

I don't like the characterization of the RFC process as a bureaucracy. RFC processes are more open than a pure "bazaar". In the lack of any formal, open process to make project changes, there ends up being a hidden informal "be friends with this person to get your patch merged" process, which is far less transparent.