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

LC_ALL=C foo, where foo is a shell function

If I type

  foo() { some_command }
  LC_ALL=C foo

then this sets LC_ALL to C in the current shell, probably because foo
is evaluated in the current shell. I wonder whether this is wanted or
this is a bug. The zsh FAQ says in "Why do my csh aliases not work?":

  Otherwise, your aliases probably contain references to the command
  line of the form `\!*', etc. Zsh does not handle this behaviour as
  it has shell functions which provide a way of solving this problem
  more consistent with other forms of argument handling.

This is not a good advice due to the possible side effects (unless
the above behavior is really a bug, but bash behaves in the same way
as zsh). The FAQ should be updated to point out this problem.

Shouldn't the form with parameter assignments be disavised (except
in the cases where this has the wanted effect) in favor of the env

Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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