Pacman hooks Exec are not run in a shell so bash syntax is not supported. Using /bin/sh -c '...' is the way to go.