Ask HN: How can I get better at bash?
191–195 of 195 posts
Re: Ask HN: How can I get better at bash?
#192Besides the obvious answers of just reading the manual, looking up howtos, and stackoverflow I can recommend some habits that might increase your uptake of bash. 1. If you are not running a unix as your default OS switch to one (ie Linux or Mac). 2. Create a bin (~/bin) directory in your home directory of all your shells scripts and source control it. Any script you ever write put in that directory. Even if its not b…
I've not been able to find anything good on setting up a dev machine image with packer.
Re: Ask HN: How can I get better at bash?
#193Earlier quoted context omitted.
Bash is unbeatable as a functional concept for chaining command-line tools together. Once you start getting functions or even a lot of if/while constructs, it's usually time to switch to Python/Perl.
I wrote a guide to the shell (posted elsewhere here). I concur with this statement wholeheartedly. Bash as a command language is exceptional, as a scripting language it is sub-par at best. I've been using Ruby a lot lately in command line scripting, little things like $ ls /*.orig | ruby -e 'while f = gets do ... end' It's not quite as easy as the shell tools for little things, but I feel like the crossover point whe…
Now my metric is, "if it needs a function, or even a complex while loop,switch to perl/ruby"
Re: Ask HN: How can I get better at bash?
#194Earlier quoted context omitted.
I wrote a guide to the shell (posted elsewhere here). I concur with this statement wholeheartedly. Bash as a command language is exceptional, as a scripting language it is sub-par at best. I've been using Ruby a lot lately in command line scripting, little things like $ ls /*.orig | ruby -e 'while f = gets do ... end' It's not quite as easy as the shell tools for little things, but I feel like the crossover point whe…
I used to think of it in terms of "number of lines" but then I found a task that worked quite well in a longer bash script (creating a .deb file). In fact, it worked better than if it were a python script, because all the commands were right there. Now my metric is, "if it needs a function, or even a complex while loop,switch to perl/ruby"
Re: Ask HN: How can I get better at bash?
#195Earlier quoted context omitted.
I wrote a guide to the shell (posted elsewhere here). I concur with this statement wholeheartedly. Bash as a command language is exceptional, as a scripting language it is sub-par at best. I've been using Ruby a lot lately in command line scripting, little things like $ ls /*.orig | ruby -e 'while f = gets do ... end' It's not quite as easy as the shell tools for little things, but I feel like the crossover point whe…
I used to think of it in terms of "number of lines" but then I found a task that worked quite well in a longer bash script (creating a .deb file). In fact, it worked better than if it were a python script, because all the commands were right there. Now my metric is, "if it needs a function, or even a complex while loop,switch to perl/ruby"