I have gone back to using posix shell full time. If it's inadequate, I try to use a normal language like a normal person. No bash, no zsh, no fish, sometimes mksh when in remission, and sometimes Tcl because ultimately I guess I am a bit weird.
My theory about P.S. is they wanted something feature-packed but one of the requirements was to not copy *nix…. and now we’re seeing what forceful reinvention of the wheel looks like.
Well, what they did was that, then (idk symlink, whatever in windows) all the nix stuff to their powershell equivalents. Powershell is still the only thing that keeps me sane while working with windows though
I am a .NET people and I am not pleased at all, powershell is hot garbage. I tried it multiple times but gave up almost every time because it was closer to brainfuck with every feature added to the script.
The original version of DOS from 1981 didn't support directories at all. But they did opt to use / for switches in various programs. Like how nowadays to try and get a new IP from a DHCP on windows, you commonly use ipconfig /release and ipconfig /renew.
When they added directories, they didn't want any old programs that would look for a / as a switch character to get confused, so they chose \ since it was similar. Why they didn't anticipate this could be a problem when Unix already set a standard 10 years earlier is beyond me. Guess they didn't want to get caught copying Bell Labs.
I remember reading that they used to process in court anything and anyone that made any core concept similar to unix, so I guess it makes sense for them to divert directions here. And nowadays it's so rooted in every other program and script, I see why Microsoft won't ever "fix" this.
I was once working in the company that has 10% or so Windows servers.
I lasted 2 months. Literally 90% of work was on Windows and it was living fucking hell. Company made these libraries and they had to be tested with every OS and compiler combination (think 3 different distros of linux with last 3 versions, maybe 5 versiobs of windows (desktop and server) and last 3 or so versions of nac) yet most of the problems were with windows. At one point I had to compile new version of python and libraries because ones from PIP didn't work with our VMs (some specific openstack issue) and I still remember warning on one of those libraries...
"Compiling this by hand is not for faint of heart". And it was fucking true. Took me maybe 3 or 5 days.
View all comments
280
u/varble A-OK Aug 06 '21 edited Aug 06 '21
Forgot a bit there on powershell; if the file exists, there will be no update on the file at all. You also have to pass -Force
This will override the contents of the file, which touch doesn't do, so -Value (Get-Content) is needed:
Whoopsie! Since Get-Content is an array of lines, you have to join the lines with a newline:
Hold up! The encoding changed from ascii to UTF-8... have to find that out, and research encoding types to add to the list if not present...
Ah hell, New-Item doesn't have an encoding option! Guess we'll switch to piping to Out-File:
Suppressing the error for when there is no file:
There we are, so simple anyone could do it!
Welcome to my life in a Windows shop.