EDIT: Das Beispiel funktioniert in reinem zsh. Meine Installation mit prezto wird nicht funktionieren. Scheint wie ein Fehler in prezto.Unerwartete zsh globale Alias-Erweiterung
Ich habe versucht, alias sponge
als SP
in zsh. Aber das Ergebnis ist ziemlich überraschend.
Ohne globale Alias:
❯ echo xxx >! xxx
❯ cat xxx | sponge xxx
❯ cat xxx # non-empty file
xxx
Mit globalen alias:
❯ echo xxx >! xxx
❯ alias -g SP='| sponge '
❯ cat xxx SP xxx
❯ cat xxx
(empty file, no lines are shown here)
Was die Ursache für das seltsame Verhalten ist? Wie kann ich es zum Laufen bringen?