Tech Reflect
  • Home
  • About This Site
  • Contact me
  • Search Icon
Flow control in bash

Flow control in bash

2018-02-16

It seems like whenever I want to write an if-then or case statement in bash, I spent an hour searching the web and end up finding 12 different suggested ways of doing it. I try them all and maybe one of them works if I’m lucky.

I happened to find what I think is a really great reference for this that has been a great resource for me:

Bash Scripting Tutorial – 5. If Statements

Things like string comparisons, inspecting files, boolean operations, and nested flow control are some of the topics covered. Sure, there is the official bash documentation mentions this stuff, but it’s very terse and doesn’t provide good examples, if at all.

Having said all this, I highly recommend writing command-line tools in Swift:

Creating command-line tool in Swift

Not only will you be increasing your knowledge of Swift, it’s much more powerful, more easily debuggable, and Apple makes a great IDE to help you along.

Related Posts:

  • Ultra high volume email workflow
    Ultra high volume email workflow
  • Old Dock tips that are still useful
    Old Dock tips that are still useful
  • Why is my own data least important in search?
    Why is my own data least important in search?

geeky, macOS tips

Post navigation

NEXT
Simple repeating command-line command
PREVIOUS
Moderately advanced searching in Mail

Get Monthly Updates

Recent Posts

  • Flower Power and Blue Dalmatian to the rescue?
  • “Why does Mail have to be so fucking complicated?”
  • This mouse has no tail!
  • Interview feedback and the Thumb-o-meter™
  • Buy a cactus, get hired

Categories

  • analog (1)
  • apple career (11)
  • apple inside (11)
  • apple stories (17)
  • bertrand serlet (3)
  • essays (15)
  • geeky (21)
  • interviews (4)
  • iOS tips (3)
  • Mac OS X (2)
  • macOS tips (37)
  • personal (7)
  • products (4)
  • scott forstall (7)
  • scripting (1)
  • steve jobs (14)
  • tim cook (1)
  • workplace (14)

Get Monthly Updates

About cricket


Me with Guiness the owl

25 years in tech. I like to write manifestos. I like to offer interesting tips. I like making fun of things. Everyone copes differently.

My Other Blogs

  • Free Range Parrots
  • Plucky Tree (personal)
© 2022   All Rights Reserved.