...which is exactly what you're meant to do.
This is not an example of how bad Bash it, it shows that you didn't understand what Bash is. It's expected to use various languages to write code on Linux, nobody wants you to do things in a language that wasn't made for the task.
Imagine you had to use Python on the shell and, any time you open a terminal, needed to import os and do something like print(os.path.glob("*")) instead of just opening a terminal and typing "ls" to get your directory listing. Different tools for different jobs.
Also the point they try to make about bash looking like a foreign language and having weird syntax. Yes, that's the thing: it's a very specific thing called a shell, not just any old programming language that you're meant to use for things that are not shell scripts. If Python feels more natural to you, that's probably what you should be using. Don't feel like you need to use Bash for bigger tasks than a few lines of code for no reason other than because you're on a system that has it.
> A lot of people coming from the Unix-like world of macOS and Linux don't tend to know [PS]. Many people don't know it even exists at all. When I mention the Windows Terminal to people, they think I'm talking about the Windows Command Prompt, a crappy little program
I know that PS and the new terminal is not the same as cmd.exe, and that it has advantages like passing objects through pipes instead of stringly typing everything the way that sh-like shells work. But that's about the extent of it. (The powershell command names though, oh boy, even Java method names are better than that.)
> PowerShell also runs on Unix-like systems through PowerShell Core
I forgot about that. If anyone's interested in this, you may also enjoy learning that you can now run Windows Defender on Linux! And Internet Edgesplorer! The software we've all been waiting for, according to the Microsoft press release :D. These things amuse me to no end, but more seriously, getting to know PS better and trying out this object passing system does sound interesting.
Similar to how C# is secretly my favorite language, but it's just not well supported on Linux (mono and .netcore with monodevelop or the electron app called "VS Code" are just not the same as the Windows experience, e.g. Windows Forms and the real Visual Studio being huge omissions for me).
C# is not-so-secretly my favorite language (though Clojure is a close second) and I use it pretty often on macos/linux.
IDE wise have you given Rider a try? Imo it's a totally viable Visual Studio replacement for most C# dev, though not as nice for all workflows or related tech.
Worth looking at if you haven't. It's not free, though, so that can blow depending on your tolerance for licensing. I've personally had an all-products pass with jetbrains for awhile now, so doesn't bug me, but ymmv
I also get a lot of mileage out of C# notebooks in VSCode. Honestly, I use C# for a ton of my daily scripting because I built up so many utility scripts over the years in LINQPad on windows, and they were pretty trivial to port
Just wondering if you're talking about command name length or something else?
Asking because it comes up a lot and almost all the common commands have idiomatic short/terse versions (gci for Get-ChildItem, etc).
No shade, though. No reason you'd know if you don't have a reason to know it.
Would love to hear if I'm making the wrong assumption and it's something else you're talking about. I personally really love powershell, but also get why people love bash. I'm still pretty comfortable with bash because I work in *nix systems mostly, so it makes sense for me to know it, whereas the reverse (with ps) isn't really true for most devs
We all have different experiences of life but I have never found this to be the case. Linux users are savvy and curious about things even outside their bubble.
The only people I can imagine this being true for is the true greybeards who have been daily driving Linux for 20 years.
For PS, the other thing is I think people hear "object-oriented shell" and think every command has to be custom-built to interface with all the others and isn't pluggable like standard pipes, but that is untrue.
I'm glad that the OP has a workflow that they like, but I'm not really convinced the grass is greener on the other side. I've used a lot of shells, Powershell doesn't really wow me that much anymore.
It's not the shell, it's the kernel that interprets the so-called shebang. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
Edit: oops, should have previewed, cryptonector beat me to it.
Uh, not, in that case the shell is not involved at all. The kernel implements shebang and will automatically start the interpreter, whatever it is, without having to go through the shell.
Yes … well …
We brought on via acquisition a bunch of Windows devs. It turns out we can't even clone the repository onto their laptops: some files in the repo have ":" in the filename, which is forbidden. There's a "aux.rs", also a verboten filename in Windows. And then there were some that differed only in case, which honestly I don't know how we manage that, as the non-Windows side is macOS, and yet roughly once per year someone introduces two files, same name, differing case into the repo.
> that "CRT" shader
Okay … that's not what CRTs looked like. Like, the curve seems way overdone compared to my memory, and IIRC the "lines" affect was really only visible on TV/camera. I have no memory of noticing it IRL, and I spent plenty of time at a command prompt.
(E.g., this random example — https://i.redd.it/1s3ny22b2va51.jpg — matches my memory pretty closely.)
(Also there were flat screen CRTs, but those were relatively late to the game and were rapidly obsoleted by actual flat screens.)
Edit: but also I want to play a round of Hack¹ with that shader.
¹i.e., quest for The Amulet of Yendor; you might know the newer incarnation, NetHack, but I didn't play that until flat screens, I think; the CRT time would have been on Hack.
Some people were more sensitive to CRT flickers than others but it didn't look like that, even at 60hz (a low rate for a PC monitor). It was more a flashing-the-whole-screen-on-and-off-constantly effect; the effect of moving lines in videos move far slower than 60hz.
That's not true.
> And then there were some that differed only in case, which honestly I don't know how we manage that, as the non-Windows side is macOS, and yet roughly once per year someone introduces two files, same name, differing case into the repo.
Sounds like a crappily maintained repo.
Well, just for you, I've searched the Slack history. IIRC, this was inside a WSL session in Windows, but it definitely originated on a Windows machine:
$ git checkout rename-some-files
error: invalid path 'foo-crate-1/src/aux.rs'
error: invalid path 'foo-crate-2/src/aux.rs'
error: invalid path 'foo-crate-3/src/aux.rs'
<more filenames with other errors>The story with enabling long file paths is even sadder. Explorer doesn't support them, for example.
You're complaining 'bout 'doze, not devs. Come on, dude!
> (some business about CRTs but not whatever I expected with (absolutely correct-thinking) Line Feeds at the end of every line of text.)
Um . . .
Look, I understand that you didn't have enough experience to handle these outsiders, but that seems like the most understandable outsider group I can imagine. (And I don't have to imaging 'doze habits - I've seen a bunch up-close!)
(I'm not a WSL expert, so I could be wrong here.)
More relevant in my view is how well the workstation you use supports interacting with your build system. In many organizations, the actual build environment is only ever going to be Debian or alpine in a container, in which case, it doesn’t really matter which computer you have on your desk. If all your building happens remotely on a cloud instance, it hardly matters at all.
So by all means, use whatever computer you want. The great thing about the current era of computing is how little depends on the computer for getting work done. The author’s Chromebook story makes this point perfectly. Use what you have or what you like or what you can get, and get on with life, I say.
macos used to be relevant, but now (like the jackling house) all the unix underpinnings have been left to rot.
[1] https://en.wikipedia.org/wiki/Jackling_House
By the way, macos bash is technically in violation of the GPL, as it doesn't ship the source for rootless.h (no, not the x file by the same name)
Also, regarding this example
{
$Env:MYSQL_HOST = "MyHost.com";
$Env:MYSQL_USER = "MyUser";
java -jar myprogram.jar;
}
You can do the same thing in Bash with perhaps slightly more verbosity (
export MYSQL_HOST="MyHost.com";
export MYSQL_USER="MyUser";
sh -c 'echo "using $MYSQL_USER@$MYSQL_HOST"'
)
sh -c 'echo "using $MYSQL_USER@$MYSQL_HOST"'
outputs: using MyUser@MyHost.com
using @Compare:
PS /home/me> {
>> $Env:MYSQL_HOST = "MyHost.com";
>> $Env:MYSQL_USER = "MyUser";
>> java -jar myprogram.jar;
>> }
$Env:MYSQL_HOST = "MyHost.com";
$Env:MYSQL_USER = "MyUser";
java -jar myprogram.jar;
PS /home/me> Invoke-Command -ScriptBlock {
>> $Env:MYSQL_HOST = "MyHost.com";
>> $Env:MYSQL_USER = "MyUser";
>> java -jar myprogram.jar;
>> }
Error: Unable to access jarfile myprogram.jarI certainly felt the hostility when I discovered the preloaded apps and ads in my Win11 install that aren't included in the much more expensive enterprise version.
> Microsoft plugging more ads into Windows 11 Start Menu
I mean, come on.
You can use PowerShell on Linux. You can use vcpkg on Linux (very well, even). You can learn C++ and you wont need the `_In_` and whatnot. If you use WSL2 for your development, are you even developing (fully) on Windows?
What you can't do is really own a copy of windows (any recent one), and have the freedom to decide what tools you will use. There is nothing protecting your system from locking you out of any setting, at any point, and requiring you to buy a different key, subscribing, giving them your data, or whatever else.
Maybe it wasn't clear in the post: I dont use wsl except as a backend for docker. I use powershell, not bash
> There is nothing protecting your system from locking you out of any setting, at any point, and requiring you to buy a different key, subscribing, giving them your data, or whatever else.
Thats not something I care about
Well what's the point in having a debate about any of this if you've yet to experience closed source software taking something away from you?
Two thing I can say for any naysayers who use a Mac and do devops, backend development etc.:
1. Are you sure your environment that matches your deployment environment? Do you have confidence your server code runs the same on an Apple Silicon Mac as the (very likely) x86-64 and Linux environment your users use?
2. Have you ever noticed how shell scripts on Mac often... don't work the same on Linux? The way to fix that is of course use Homebrew, and, while brew has gotten leagues better, the quality pales in comparison to even Debian testing, Ubuntu main, or Arch and others.
As a devops engineer for many years, #2 was death by a thousand cuts. If I could, I'd have replaced every Mac user's userland with GNU coreutils from brew without their permission.
To square the circle of preferring Linux systems and Windows' UI, I've done just about every approach you can imagine to make that work, from syncing folders via rsync, to ssh or nfs mounted filesystems. I've used Virtualbox and VMWare and Hyper-V to locally run the Linux environment. There have been a few different X window managers and remote desktop tools, but none of them have been great.
WSL1 is where things really began to turn around - what an interesting project to make the NT kernel work as a Linux kernel. It didn't quite pan out, but that was OK.
WSL2 made major changes to how WSL worked, and now I can now run Kubernetes, Docker, 3d applications, machine learning (stable diffusion), have a real Linux shell and userland.
WSL2 is a true game changer for quality of Linux development on Windows. Being able to `docker run` Stable Diffusion or Llama or what-have-you is incredible.
I can imagine a PopOS - or another vendor-backed Linux OS - might persuade me eventually to shed Windows. In the meantime, I don't feel like I'm making any compromises.
I’d argue that a lot of us are developing SaaS etc and the browser is our main touch point, so this isn’t necessarily as relevant.
I recently had this issue where my version of SSH was too new compared to that the servers were running and I was getting issues about the cryptographic algorithm being mismatched.
I think that when your encryption algorithm gets removed, after having been deprecated, is really time to upgrade instead of commenting on ycombinator.
Also idk if this is a problem for anyone else, but since admin privs are required to add to path, I need to fetch IT every time I need to add to it on my work machine, lol.
[0] https://superuser.com/questions/1385854/how-do-i-bypass-rest...
The commands are verbose and the syntax is non-standard in a way that, quite frankly, is unnecessarily and exceptionally annoying.
But the worst thing is some super confusing aspect of how scopes for variables etc work.. which I've somehow forgotten already because the last few times I needed to write something in PS I straight-up got ChatGPT to do the legwork.
Also, many people here are saying "yes, I know all about powershell and the terminal and path variables, this is all obvious", but my experience IRL with developers who use macbooks is that they haven't touched windows since maybe 7 and literally did not know anything about the various features here. So if the information here is unconvincing, thats fine. If its not news to you, then you're probably not the kind of person I'm talking about
Addi
Around the same time that came out, so did WSL so I never really learned PowerShell because now it's so easy to run real bash on Windows.
Are you suggesting that cygwin's bash is not "native"? It isn't installed by default, obviously, but it is a native Windows executable, as are the other command-line tools generally installed with it.
I also felt bash was cryptic before I decided to actually learn it. Now it's one of my favourite languages. All it took was reading "man bash", which is actually super clear and surprisingly enjoyable to read for a manpage.
As I was reading this article, initially I felt like I wanted to "rebut" the claims, but by the time I finished reading, I realised I would basically end up having to rebut the whole thing. (and doing so on a phone is simply not worth it).
Honestly, learn bash. It's actually beautiful. By all means, use PS too; but judging from your article, you're missing out on a lot of great stuff.
You only had a response to the powershell part?
We're not disagreeing then. I specifically said I also felt bash felt cryptic back when I thought I "knew" it, but didn't really know it, as it turned out. Casual familiarity, or even frequent but superficial friction with bash definitely leaves one feeling they're dealing with incomprehensible symbols and hackiness most of the time.
But, the thing is, I'm not "guessing" you don't know it well enough. I'm inferring it clearly from how you described it in the text. Because it reminds me exactly of how I used to think about it too, before I invested the time and learned to love it. Perhaps you think you know it well enough, but the way you talk about it suggests you don't really. Unless of course you intentionally chose very contrived examples to push a point, but it didn't seem to me that that's what you were trying to do.
That's not to say that once you learn it properly you will certainly 100% percent love it and ditch PS of course. I'm just saying from the way you describe how you work with it, you don't sound like someone who's really really gotten comfortable with it and learned to rely on it. And if and when you did, I suspect you'd start liking it more. Happy to be proven wrong of course (not that that's important either way, we're just random guys expressing personal opinions over the internet :p ).
> You only had a response to the powershell part?
Yes. I don't really have a strong opinion (positive or negative) about the rest. Nicely written though, thanks for the read.
The bit that I did agree with quite a bit was the sad state of macs. But I don't think that necessarily makes the current Windows experience the pinnacle of development; it just makes macs worse. (how the Apple marketing machine manages to promote macs as "the best at X" when they're arguably pretty consistently the worst at X, for most Xs, is absolutely mindblowing to me).
I'd go more with buggy but functional once you know its limitations.
Copy and paste is broken, tab naming and management is broken, its still pretty rough around the edges.
For tabs I don't care much as not using them.
To properly work with git I installed gitbash -- that is essentially Linux in a box, complete with git, ssh and the basic bash tools like cat.
To do more complicated things, you can install WSL, which is literally a virtual machine running Linux, well integrated with the Windows system.
The problem of course is that well-integrated is not the same as native, but MS does have some of the best languages available, C# is pretty great.
Looks like author missed the most obvious and popular OSS one: https://picocli.info/
You just don't ever get to build anything - so problem solved! :)
It's apt install these days.