Managing tasks directly from the terminal can be a breeze with the power of shell scripting! In this post, I'll walk you through creating a simple ...
For further actions, you may consider blocking this person and/or reporting abuse
Bash has always been this mystery to me, every time I need a script I would reach for PHP or Ruby
I completely understand you! I often feel the same way. Bash isnβt my main language, but I enjoy challenging myself from time to time. When it's something urgent, of course, Iβll turn to a tool or language Iβm more comfortable with. However, whenever possible, it's worth stepping out of your comfort zone and trying something new. Sometimes, in those moments, you might gain insights from a language you're less familiar with, which you can even apply to your primary one. If you have the time β and sometimes the sanity β give it a try!
that's cool
Bash is pretty easy with one major exception. When your command includes any tokens that bash recognizes, it will attempt to perform several types of expansions to it. It does this iteratively until nothing else will expand.
When you take advantage of this on purpose, it's great, but getting it to leave something the way it was using quoting/escaping can be quite challenging. You have to learn that the hard way - mostly by trial and error. The bash trace flags (-v and -x) help with figuring out how the original text of the script gets expanded.
Also, some people make a variable names uppercase for some reason. I started out that way, but switched to lowercase for everything except environment variables.
I hear people say bash is great until you need an array
But who needs them? Bash and arrays have a relationship as smooth as trying to split a string without 'awk'
W
Bash has normal and associative arrays. The syntax can be a bit clunky and it only supports one dimensional arrays, so you have to make arrays of arrays for more dimensions.
I'm a big fan of awk. It's usually way easier than sed whenever you have to do context dependent editing. And you can add print statements to it for viewing partial results... A lot of people ignore cut. It's great for simple things.
That's a perfect way to get a whole new app with almost no effort.
I have a similar one for an activity journal/log.
One slight improvement. tlc() uses what is known as a useless cat. It can be:
I also added quotes to defend against things like embedded blanks. Shell variables should usually be quoted unless there's specific reason not to.
That makes a lot of sense, thanks!
Really enjoyed this piece!
Thanks for that!
Nice
Thanks!
whoa, TODO list in shell, why not?
why NOT?! lol
This is way too great, I will definitely use this one on my workspace!
Hey, I'm excited about this!