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 fully documented.

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

Note Z-Shell scripts are generally more up to date than their Bash equivalents.

Tools and Utilities

zsh

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

bash

  • 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.

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).

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

Note These are getting a bit long in the tooth, and may no longer be relevant to the latest macOS versions.

zsh

bash


Source Code

You can view these scripts’ source code at GitHub.


Related Software


smittytonesmittytone
Site and software copyright © 2024, Tony Smith