Shell Scripts

A selection of useful Z and Bash scripts

 

In the case of scripts which operate as utilities, use the --help switch to learn how to make use of the tool. Scripts which are intended to be run once — for example, the Raspberry Pi setup scripts — are documented in their comments. Scripts run in other contexts, eg. in Xcode, are not yet documented.

Click on the name of the script to go and view its source code.

Tools and Utilities

zsh

  • hugo-deploy.zsh — Build and deploy a Hugo-based site to a Git Pages repo.

bash

  • imageprep.sh — An image processing script. See this blog post for some context.
  • imagenum.sh — Rename and number a sequence of PNG files, and convert them to JPEG.
  • cbz_blitzer.sh — Locate .cbz comic files in the current directory (and sub-directories) and convert them to PDFs. Requires pdfmaker.
  • lowerext.sh — Convert the working directory’s file extensions to lowercase.
  • pdfer.sh — Converts .docx files downloaded from Google Docs to .pdf.

Xcode and Development

zsh

  • packapp.zsh — Package macOS app binaries for distribution outside the App Store.
  • packapp.zsh — Package macOS command line app binaries for distribution.
  • outman.zsh — Convert man pages to text files.

bash

  • iconprep.sh — Generate icons for macOS/watchOS/iOS app projects.
  • xcodeautobuild.sh — A script for auto-incrementing a project’s build number at build time.

Mac Setup and Config

zsh

bash


Raspberry Pi

zsh

bash

  • updatepi.sh — Update Pi config files from the dotfiles repo.
  • pinstall.sh — Setup script for the Raspberry Pi.
  • zinstall.sh — Setup script for the Raspberry Pi Zero.
  • pi.sh — SD card preparation script for Raspberry Pis. Note This runs on a macOS host.
  • pireadonly.sh — Hack a Raspberry Pi to run in read-only mode (no writes to the SD).

Source Code

You can view these scripts’ source code at GitHub.


Related Software


The Seal of RassilonThe Seal of Rassilon
Site and software copyright © 2020, Tony Smith
Site Last Updated: 23 October 2020