What special meaning does the equal sign in zsh have?

In my zsh script, I had a line

echo some text ================================ 

To my surprise, an error message was issued for this line:

 zsh: =============================== not found 

While experimenting with the command line, I found that the shell gets frustrated when there is an equal sign:

 $ echo =z zsh: z not found 

But here we have:

 $ echo =echo /usr/bin/echo 

From this observation, he looks as if

 =XXX 

will be interpreted as

 $(which XXX) 

However, I did not find anything about this "replacement" in the zsh man page. Where is this magic described?

+6
source share
1 answer

From docs :

14.7.3 '= extension

If a word begins with unquoted '= and the EQUALS option is set, the rest of the word is taken as the command name. If a command exists under this name, the word is replaced by the fully qualified path name of the command.

And here in more words

+6
source

Source: https://habr.com/ru/post/982735/


All Articles