This was unexpected: % echo 'a/path with spaces/in/quotes' a/path/in/quotes % echo !:1:h quote> I was expecting the equivalent of % echo 'a/path/in' What seems to work is % echo !:1:h' It just seemed odd to me.