I would like to change my zsh prompt color, if $PWD is currently on tmpfs mounted filesystem.
Lets say for example, /dev/shm is a tmpfs filesystem. I can confirm that:
$ grep /dev/shm /proc/mounts tmpfs /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=26307700k 0 0 so, when I am in /dev/shm, I can do:
grep -q "^tmpfs $PWD tmpfs " /proc/mounts But that will not work, if I stand in /dev/shm/foo, or /dev/shm/foo/bar, and so on.
How can I check whether $PWD is on a tmpfs filesystem ?