Cacher App
Published in

Cacher App

Run Cacher snippet contents through bash commands

A question that often comes up is whether you can run snippet file contents in a shell (like bash or zsh). The answer is yes and here is how.

TLDR: Check out the snippet.

For example, suppose that you have a set of commands you need to run on the machine of every new engineer. These commands install Homebrew and wget. You could write a snippet with the following as the file’s content:

echo "Running setup commands ..."echo "Installing Homebrew ..."
/usr/bin/ruby -e "$(curl -fsSL"
echo "Installing wget ..."
brew install wget

Save it as either a private or public snippet.

If you saved a private snippet, click on Share for the file, then toggle on the Public URL for the file:

Turn on the public URL for the snippet file

Otherwise, if the snippet is public, click on the View Raw link in the file’s header to open a browser tab to the URL.

Then, simply curl the file contents into bash to run the commands:

\curl -sSL | bash

Obviously, you’re not limited to to executing shell commands. You could use any HTTP client written in any language to retrieve snippet file contents. You could say, write a RSS feed that gets consumed by Feedparser… or write a portable config file that gets used by CI builds.

Do you have any cool uses for Cacher snippets? Let us know in the comments.

Want to remember this technique? Save the snippet for this blog post to your Cacher library.

Cacher is a code snippet organizer for pro developers. Try it at




The code snippet organizer for professional developers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rui Jiang

Rui Jiang

Founder of Cacher, Human Penguin

More from Medium

My Experience CodeText Editors#1#VSCode,Vim,Neovim,Atom

Drupal common maintenance commands

How to Design a Better Command Line Interface

Linux Terminal Fundamentals. Part 1

A screenshot of the linux terminal and the “mkdir” command