I am sure it works in zsh.  I guess it works in POSIX-compliant shell.