Zsh: unknown file attribute

I have the following function in mine .zshrc, which, theoretically, allows me to write a commit message without quotes.

cm(){
    git commit -m "$@"
}

When I ran it ( cm foo bar), I get the following error:

zsh: unknown file attribute

Does $@zsh mean the same as bash?

+4
source share
1 answer

In accordance with this article , *and @contain an array of positional parameters.

Parameters *, @and argvare arrays containing all positional parameters; thus, $argv[n]etc., is equivalently simple $n.

AND...

[*] [@] ; , , . "$foo[*]" "$foo[1] $foo[2] ...", "$foo[@]" "$foo[1]" "$foo[2]" ....

+2

All Articles