Skip to main content

macos/fshard

1#!/usr/bin/env bash
2# fshard prints the lowercased first character of the filename of the
3# frontmost selected item in Finder.
4#
5# I use this when sharding files into directories based on filenames.
7set -o errexit
8set -o nounset
10filename=$(basename "$(ffile)")
11echo -n "${filename:0:1}" | tr '[:upper:]' '[:lower:]'