Running Shell Commands

TextBuddy v1.2 will let you pipe your text into any shell command that accepts stdin and insert the results from stdout back into your document.

In this example, I want a list of all the Microsoft apps on my Mac sorted in reverse alphabetical order. The steps are:

  1. Run ls /Applications to get a list of all the applications on my Mac.
  2. Then, grep Microsoft to filter out the apps I’m not interested in.
  3. And finally, sort -r to reverse the remaining list.

Shell commands don’t have to live independently of other TextBuddy commands. Here’s another example where I want to find all the URLs on my blog’s home page that only point to other pages on my website.

  1. Run curl https://tyler.io to fetch the HTML from my blog’s front page.
  2. Use TextBuddy’s built-in command to extract all URLs.
  3. Filter out any URLs that don’t link to my domain name with grep tyler.io.