Replace spaces with dashes and make all letters lower-case in bash

June 19, 2022

a="Screenshot 2022-06-19 at 19-01-40 Garmin Connect.png" ; echo "$a" | tr '[:upper:]' '[:lower:]' | tr ' ' '-'

screenshot-2022-06-19-at-19-01-40-garmin-connect.png

Profile picture

Written by Matthew Shirtliffe Software Engineer & Co-founder of Studio 200 You can follow them on Twitter