This would be extremely handy for me in the past when I had to make both bash and bat scripts. I always hated with passion freaking Windows bat.
Batsh – A language that compiles to Bash and Windows Batch
21–30 of 130 posts
Re: Batsh – A language that compiles to Bash and Windows Batch
#22This is great for me. As part of my day job I am often stuck writing batch scripts (yes, in 2014) for clients that refuse to run powershell. Writing a simple batch script is usually not a problem, but it can be very encumbering as the complexity increases. Thank you for sharing.
In terms of performance for very basic scripts (silent software installs, 5-10 lines, registry patching, etc.), I see the performance chart as:
Batch > VBScript > Powershell
in terms of speed. I wish I had tried Jscript, because the ironic Javascript is taking over the world could have meant retro hipster superiority (and scary you could integrate JScript and VBScript into the same script by embedding them in XML type directives and using the WSF system). Now that was scarier than any of this.
As an aside, outside of speed, how do you sign scripts for clients? I love that Powershell encouraged it, but every person I have met has not bought into Powershell, and most certainly invokes "disable the cert check" completely command for all executed Powershell scripts.
Re: Batsh – A language that compiles to Bash and Windows Batch
#23I would have preferred a bash/powershell solution. Hoping no one is still writing batch files on windows... even if he is still using xp
Agreed. Powershell has almost completely replaced batch scripts, and is actually a fairly pleasant language to work with.
Re: Batsh – A language that compiles to Bash and Windows Batch
#24Re: Batsh – A language that compiles to Bash and Windows Batch
#25Love the idea of writing bash in a higher, easier to read format, similar to CoffeeScript. Unfortunately Batsh is written in OCaml (the author addresses why he uses it though). How do you use pipes in batsh?
I reckon you don't, because it's not supported in windows batch. Just googled it. Doesn't seem to be supported yet: https://github.com/BYVoid/Batsh/issues/17
Sure it is: http://www.microsoft.com/resources/documentation/windows/xp/...
Re: Batsh – A language that compiles to Bash and Windows Batch
#26I would have preferred a bash/powershell solution. Hoping no one is still writing batch files on windows... even if he is still using xp
Re: Batsh – A language that compiles to Bash and Windows Batch
#27Re: Batsh – A language that compiles to Bash and Windows Batch
#28I would have preferred a bash/powershell solution. Hoping no one is still writing batch files on windows... even if he is still using xp
Totally agree. Powershell is what you need to use on windows. It's been available on the default server install since 2008 R2. No need for batch scripts anymore.
I needed to do something and looked at using powershell, but in the end I couldn't just distribute it and have it work for whomever would be using my project. It needed to be signed or something. On the contrary, the bat script I wrote just worked and would just work for anyone who used the project.
Powershell is not a magical solution that suits everyone's needs. This kind of blanket statement helps no-one.
Re: Batsh – A language that compiles to Bash and Windows Batch
#29Re: Batsh – A language that compiles to Bash and Windows Batch
#30Great name