hdiutil: Creating case-sensitive image fs for Steam
It's a better practice to leave all uppercase variables for the shell and use lower and or mixed case for user variables in scripts. You need to preface the hdiutil attach ... command too with sudo if using /.000 as the mount point.

Here's my version of the script which works.



#!/bin/bash

set -e

mountpt="/.000"
sparseimg="/Users/Shared/Steam/steam.sparseimage"

[ ! -d "$mountpt" ] &amp;&amp;  sudo mkdir -m0777 "$mountpt"
[ ! -e "$sparseimg" ] &amp;&amp; hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 32g "$sparseimg"

sudo hdiutil attach -mountpoint "$mountpt" -nobrowse "$sparseimg"