Stronger Shell
21–30 of 80 posts
Re: Stronger Shell
#22I personally can't stand bash for writing scripts (it's fine for typing one-liners into terminal though). This question and its top answer capture the insanity of bash quite nicely http://stackoverflow.com/questions/3601515/how-to-check-if-a... .
Re: Stronger Shell
#23Re: Stronger Shell
#24Re: Stronger Shell
#25Earlier quoted context omitted.
> Is there a better shell? By which I mean more flexible, more consistent, and simpler. Yes, PowerShell. And it may actually arrive at Linux/Unix soon, due to CoreCLR. The specification is already open, but until now not much progress has been made towards bringing it uncrippled to Linux/Unix PowerShell is extremely consistent. Examples: All commands are strictly on the verb-noun form where there are only 40 or so "a…
Can you recommend a resource for learning powershell? (Assuming one has UNIX background) [it does generate annoyingly long error messages!]
$ErrorView = "CategoryView"
(unlike bash, whitespace is not significant)As for learning PowerShell, if you lean towards online training, Microsoft Virtual Acedemy has a really good series of courses, even featuring Jeffrey Snover - who is surprisingly good at explaining stuff.
This is a good starting point:
https://www.microsoftvirtualacademy.com/en-US/training-cours...
I usually prefer books/articles etc where I can set my own pace, but those online courses are really that good.
Otherwise links: * https://technet.microsoft.com/en-us/library/cc281945(v=sql.1... * http://learn-powershell.net/
And let's not forget the very friendly community at http://powershell.org/ with articles such as this one: http://powershell.org/wp/2015/07/31/introduction-to-powershe...
Re: Stronger Shell
#26I personally can't stand bash for writing scripts (it's fine for typing one-liners into terminal though). This question and its top answer capture the insanity of bash quite nicely http://stackoverflow.com/questions/3601515/how-to-check-if-a... .
Yeah, this is insane and the default settings of bash are quite horrible. You can set some bash options in the beginning to avoid such problems. For the StackOverflow problem "set -o nounset" can be a good safeguard. Other options to look into to safeguard bash scripts from some insane behavior are "errexit" and "pipefail". Even though setting these is good practice, it doesn't stop some stuff that could be expected to be stopped by these. These options are not inherited to subshells invoked by command substitution and the likes. They wouldn't have stopped this nasty steam bug [1] for example. There are other nasty quirks too, it's really hard to unfck bash.
[1] https://github.com/ValveSoftware/steam-for-linux/issues/3671...
Re: Stronger Shell
#27actually [ is same as test and the last ] is just the last (useless) argument of [ , iirc
Re: Stronger Shell
#28Confession: The horrors of bash set back my programming hobby until high school. Even then, I didn't actually like interacting with my computer programmatically until I found a comfortable set of tools sometime in college. I'm lucky that my day job lets me use the tools I like and avoid systems like the bash shell.
Re: Stronger Shell
#29There is just one thing I will never understand. The tired argument of "...but it isn't portable". Features that are new, and make programming bash easier (such as "[" vs "[["), are looked down upon in some circles because it isn't portable. If I'm programming for bash, then upon deployment, I'll be using bash. To use another shell, and hope it just works is a bit insane.
I'd also like to second using the Fish shell. Far better than bash/zsh for everyday use, and I just can't go back to other shells.
Re: Stronger Shell
#30If you're writing shell scripts, you might as well write Ansible playbooks. You can use Ansible playbooks locally without the SSH layer. Bash/sh is a horrible programming language.