5 ms·
> 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...
by 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]
- robertelder 10y agoOk, I'll try another use case: Political differences (specifically licensing). This project appears to be licensed under MIT, and python appears to be licensed under !MIT. I don't know what the implications are for the licensing of machine-produced shell code, or binary versions of Python, but I'm sure there are companies out there that would have opinions to favour one alternative over the other for reasons other than the technical merits of the choice.
- xyience 10y agoMaybe. Python is under an MIT-like license, so you're fine, but if it were under e.g. the GPL you could still look to see if they have some form of runtime exception as GCC does. In any case it's rare for a company that's not well-established to care more about licensing that technical merit (and even any that do, the typical approach is to ask to buy a separate license if possible), and it's also rare that a company would use such a tool as this (created as a hackday project, in Ocaml, according to the author) rather than finding an alternative that meets their licensing criteria or just developing it in-house since it's not that big a tool and lacks a lot of useful capabilities like piping.
- somabc 10y agoIn that case you would use the chocolatey package manager bootstrapped by powershell to silently install Python. It's a oneliner in powershell followed by choco install Python.
- 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.