A02alias.ztst   [plain text]

# To get the "command not found" message when aliasing is suppressed
# we need, er, a command that isn't found.
# The other aliases are only ever used as aliases.

  alias ThisCommandDefinitelyDoesNotExist=echo

  alias -g bar=echo

  alias '\bar=echo'

  ThisCommandDefinitelyDoesNotExist ThisCommandDefinitelyDoesNotExist
0:Basic aliasing

  bar bar
0:Global aliasing

  \ThisCommandDefinitelyDoesNotExist ThisCommandDefinitelyDoesNotExist
127:Not aliasing
?(eval):1: command not found: ThisCommandDefinitelyDoesNotExist

  \bar \bar
0:Aliasing with a backslash

  (alias '!=echo This command has the argument'
  eval 'print Without
  ! true'
  setopt posixaliases
  eval 'print With
  ! true')
>This command has the argument true

  print -u $ZTST_fd 'This test hangs the shell when it fails...'
  alias cat='LC_ALL=C cat'
  cat <(echo foo | cat)
0:Alias expansion works at the end of parsed strings