3 ms·
> If the task is simple, then a bash script would be better. Bash script don't work on the Windows command line, and bash relies on UNIX tools as its "standard
by flohofwoe 5y ago
> If the task is simple, then a bash script would be better.
Bash script don't work on the Windows command line, and bash relies on UNIX tools as its "standard library", which also are not available on the Windows command line. That's the whole point really, Python has very good cross-platform support (and in this case cross-platform doesn't just mean "Linux and macOS", but also Windows).
> If the task is not so simple, then a language you are really familar with is better.
IMHO every programmer should be familiar with at least a handful programming languages.
- hsn915 5y agoBash can and does work on windows if you install it. Just like Python. Also doesn't windows now ship with a linux compatibility layer anyway (WSL)? EDIT: I just realized you are the guy who wrote sokol! If your main work station is windows and you don't work on linux, then replace bash from my previous comment with bat(ch).
- flohofwoe 5y agoBash is not the standard shell on Windows, and it also relies very much on UNIX-style filesystem conventions that don't map very well to the Windows environment. I wouldn't ask my users to install PowerShell on Linux or macOS either. Asking Windows users to run Bash scripts is essentially the same as asking them to build a C/C++ project that uses Autotools and Makefiles. It may work with lots of tinkering, but it's a massive world of pain. > If your main work station is windows and you don't work on linux, then replace bash from my previous comment with bat(ch). I usually switch between macOS, Linux and Windows at least several times a week, sometimes several times a day, maintaining different scripts to do the same thing wouldn't make sense.
- Supermancho 5y ago> Bash is not the standard shell on Windows, and it also relies very much on UNIX-style filesystem conventions that don't map very well to the Windows environment. Windows was built by people who started by copying from Unix. This is part of the reason Bash works fine on Windows (ie What is your problem with it "mapping" to things?). You can pipe commands, you can stream text, you can edit binaries. There are things that slow down (or can't be done, modify permissions easily, etc) because of Windows tradeoffs, not because it's fundamentally different. An OS does OS things and a shell talks to the OS.
- goohle 5y agoJust write in the header of the script: "This script requires Fedora Linux 33 or higher" and forget about outdated OS'es, unless it's your paid job to supported them. If you OS vendor refuses to supply you with appropriate tools to do your job, then just chose another vendor. Vote with your foots.