Caution required – curl | bash
Sometimes you won’t find a pre-built package for the software you need. And that’s okay! Many online sources – even trustworthy and popular ones like homebrew on macOS – recommend a command-line install process that looks like this:
curl $SOMEURL | bash
This uses the curl
command to download content from the web, and then uses that content as the input (|
, the pipe character, which we covered in Chapter 1, How the Command Line Works) for running Bash. When you do this, you’re essentially running a script on the web instead of as a local file. This can be an extremely convenient way of installing software, but please make absolutely sure that it’s coming from a trustworthy source.
We recommend always at least looking at the script source, which you can see in the browser by visiting the script URL for this command (represented in the example below as $SOMEURL
), or by splitting the single curl...