Jim Hall is an open source software advocate and developer, best known for usability testing in GNOME and as the founder + project coordinator of FreeDOS. At work, Jim is CEO of Hallmentum, an IT executive consulting company that provides hands-on IT Leadership training, workshops, and coaching.
Jim Hall
| Connect jimfhall
Minnesota
Authored Comments
I also use gnome-terminal most of the time - but sometimes I'll use Cool Retro Term for that 80s throwback feel.
Great article!
The 'if' statement can come in really handy in all Bash scripts. And for very short 'if' statements, the && and || shortcuts are also useful. For example, I often do this when I need to be sure a directory exists:
[ -d "$1" ] || mkdir --parents "$1"
That statement create the directory only if it doesn't exist. You could also write the statement like this:
[ ! -d "$1" ] && mkdir --parents "$1"
The && means "if the test was true, then do the next statement." And the || means "if the test wasn't true, then do the next statement." You can think of them as "AND" and "OR" at the execution level.