6 ms·
The attraction for me is not about portability, it's about having a better language to write CMD script. Even when you know you have Python available sometimes
by marshray 10y ago
The attraction for me is not about portability, it's about having a better language to write CMD script.
Even when you know you have Python available sometimes you still need to glue things together with CMD.
- jheriko 10y ago> sometimes you still need to glue things together with CMD why? is there something cmd can do that python can't? one example is enough...
- Karunamon 10y agoIt's not about can or can't I think. Examples: Language runtime can't be installed, system locked down with deepfreeze, not enough permissions..
- tmuir 10y agoThose aren't normally solved with scripting. However, any language with the ability to issue arbitrary system commands can accomplish everything a command line can.
- choward 10y agoThen how will batsh get installed?
- ZoF 10y agoIsn't the entire premise of batsh that it compiles to bat? Why would you need to install batsh?
- robertelder 10y agoI don't use windows much anymore so there might be a better way to do this, but I'll propose a use case: Automating the installation of python on a fresh machine.
- choward 10y agoHow are you going to install batsh though?
- xyience 10y agoFresh machine where and for whom? I doubt a simple batch script will get you very far (setup.exe exists for a reason...), and I doubly-doubt you would have enough overlap in the process that something that can convert the steps to bash would be an advantage. The only advantage I see for batsh is that it looks nicer to write in for the tiny subset of batch it supports. But then so is pretty much anything else -- it wouldn't surprise me if someone has already written a DSL in a well known language that can output to batch or powershell, we don't need a whole new language for this.
- deleted 10y ago[deleted]
- 10y ago
- partiallypro 10y agoWho cares if Python can technically do it? If you have a CLI tool based around Bash, why would you want to rewrite it in Python and have to support it yourself and spend those man hours doing it?
- acchow 10y agoBecause then you wouldn't have to write in Bash...
- uranusjr 10y agoOr BAT. I can live (reluctantly) with Bash, but Windows batch file is just brutal.
- nomel 10y agoThe context of this article and all of these comments is writing new scripts, not rewriting old scripts. If you have a completed script that does everything you want, then none of this applies.
- Consultant32452 10y agoThese days you probably want Windows Powershell. It's built on the .NET framework so it's pretty darn powerful and AFAIK is available by default on every modern WinOS.
- deevus 10y agoPowershell _is_ great (I help run an OSS project written in Powershell), but it has a long start-up time. If you're doing it as a pre-build step for example, you don't want to add potentially seconds (!) to your build just to use powershell.
- stinos 10y agoDo you use -noprofile? (you probably should for build steps, or else make sure all your build environments have a similar profile to yours) Then the startup time is usually much better - at least I haven't seen it going over some 100s of mSec.
- ygra 10y agoStartup time used to be horrible in Windows 7 (v2, I think), but they improved it a lot since then. It starts instantly for me on my Windows 10 machine here.
- herbst 10y agoIs there a linux or mac build of Powershell? After all this years hearing it is not that bad i would really love to try it a day or two