News for hackers. Stuff that matters.
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.