Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

An incompatible behavior from bash?



Hi, Zsh developers, 

I think zsh is compatible with bash, but I found one different behavior in parameter expansion.  In the following example, I guess zsh interprets "$1:l" as a whole. Is it intentional?  I read the doc but I haven't found anything about it. https://zsh.sourceforge.io/Doc/Release/Expansion.html#Parameter-Expansion

Here is an example, I tried zsh 5.8.1 on both linux and macos. The results are the same.

% cat t.sh
param_expansion() {
  var=$1:l
  echo $var
}

param_expansion hello
% zsh t.sh
hello
% bash t.sh
hello:l


Messages sorted by: Reverse Date, Date, Thread, Author