Earlier quoted context omitted.
As I said in the other threads, the language is great, the performance has been abysmal in relation to batch (at least for me, having started with Powershell in its first release in Vista).
This eludes me but why care about the performance of a shell scripting language?
Batsh – A language that compiles to Bash and Windows Batch
121–130 of 130 posts
Re: Batsh – A language that compiles to Bash and Windows Batch
#122Earlier quoted context omitted.
This sounds like you're saying that it suits your needs, therefore we should take that as meaning it fits our needs. Unfortunately, things are not that simple. 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 ju…
There's a config switch to allow execution of scripts. I agree it's a complete pain (literally falling at the first hurdle), but it is a one-time thing change. I had mixed opinions of powershell when I tried my hand at it. The naming convention and documentation system were well designed, piping objects is an interesting concept, and IDE support was great for a terminal (step through debugger, intelligent auto comple…
Re: Batsh – A language that compiles to Bash and Windows Batch
#123Re: Batsh – A language that compiles to Bash and Windows Batch
#124Earlier quoted context omitted.
I thought powershell had to be explicitly installed/enabled even in win7. I'm not going to walk a user through that when I can do what I want in batch (with more pain, but still less than ending up providing support...). My normal area is Linux though, and both powershell and batch make me appreciate bash so much more. Even those little things like being able to format arbitrary dates as you want...
Powershell is actually a really nice shell/scripting language. I often miss its power, simplicity and not to mention the immense amount of flexibility having all of .net accessible when using a 'nix box.
Re: Batsh – A language that compiles to Bash and Windows Batch
#125Was discouraged at it being OCaml, but because you made it web based so it's accessible to everyone, you win a free internet.
What’s wrong with OCaml?
Re: Batsh – A language that compiles to Bash and Windows Batch
#126Earlier quoted context omitted.
| You have that guarantee starting with Windows 7. Version is one thing; some nice things are available only in v3+, but v2 is very usable already. I love me some Powershell. Wrote my first non-trivial PS script in early 2010 that was a major component to building something I would now call "Continuous deployment of Windows OS images." But I still have way more lines of BAT in production than PS1 because the versioni…
This is not an example of evolving syntax. It's just a bunch of parameter sets added to Where-Object. New syntax is the -in operator for example (reverse of -contains). However, I find myself using the new parameter sets for Where-Object very infrequently. Since they can only model Property -Operator Value their use is limited to certain operations, which I find myself to need not that often. And if the conditions ge…
• Operation Statements vs Script Blocks
• Several new operators
• Changes to $PSScriptRoot and $MyInvocation
• Stop parsing symbol --%
• Ordered dictionaries
• New redirection operators
• Count and Length properties added to "arrays" of zero or one
• Retrieving a property from a collection that only exists in the individual items returns the value from all items.
• BadNumericConstantRe: Batsh – A language that compiles to Bash and Windows Batch
#127One peculiarity of batch files, and how cmd.exe executes them is that they are being read over and over (or maybe they are simply mapped file). I've found this by trial-and-error - while I was editing a batch file that was executing, it would suddenly error out with meaningless info, sometimes it'll print out the things I've just added to it.
This is actually true of bash as well (and has bitten me a few times). Try this: $ echo 'echo hello; sleep 2' >/tmp/hm.sh; bash /tmp/hm.sh & (sleep 1; echo 'ls /bin' >>/tmp/hm.sh); sleep 3
Re: Batsh – A language that compiles to Bash and Windows Batch
#128Earlier quoted context omitted.
The main issue with powershell is portability - no guarantee that someone's Windows box will have it installed or not. I recently wrote a batch script just to make sure it'd run on any Windows system rather than risk powershell. If it was always going to run in a controlled environment, I'd have written it in cygwin bash anyway.
Powershell is available on every Server install since 2008 R2. At this point it can be considered standard on every non-ancient Windows box, similar to assuming bash vs sh for example.
Yes, it's on all Windows Server installs, but those are not all windows boxen by a long way.
Re: Batsh – A language that compiles to Bash and Windows Batch
#129Earlier quoted context omitted.
Powershell is actually a really nice shell/scripting language. I often miss its power, simplicity and not to mention the immense amount of flexibility having all of .net accessible when using a 'nix box.
That sounds like a symptom of simply being more familiar with the Windows environment. People who have grown up in China probably find chopsticks simpler and more powerful than forks -- I'm hypothesizing -- but not because forks don't work.
Re: Batsh – A language that compiles to Bash and Windows Batch
#130Earlier quoted context omitted.
That sounds like a symptom of simply being more familiar with the Windows environment. People who have grown up in China probably find chopsticks simpler and more powerful than forks -- I'm hypothesizing -- but not because forks don't work.
I wouldn't say so. I would kill for a halfway decent Ruby shell. On Windows I'd be going on about the power of .net and on nix I'd be promoting how awesome having the power of gems in my shell is. Powershell really is quite good and blows sh/bash/zsh out of the water. The "everything is an object" model instead of passing around strings really changes how you work.
I'm not sold on Ruby gems. I haven't learned Ruby yet. Shell scripting to me means bash (or /bin/sh) + whatever utilities come standard on a unix system: sed, awk, etc.
The goals may be slightly different, reflecting the different cultures using the shells. What I think is cool about bash scripting is that I use bash constantly, anyway, which makes it easy to test small script fragments before including them in a full-on script, and even though, e.g., some things are nasty to do syntactically in bash, I get lots of practice.