Correction. It’s because the lines are malformed. Whoever added them to your ~/.tcshrc
file didn’t seem to understand how it works.
The tcsh alias
command is of the form alias foo bar
. This creates an alias foo
, which when typed will execute bar
. But certain special shell-interpreted characters will be processed by the shell when creating the alias, instead of being part of the alias’s text.
Specfically, the pipe (|
) character is one such character. So when the shell run the following line at startup:
alias pman man -t !^ | open -f -a /Applications/Preview.app/
It is creating an alias where pman
will call man -t !^
, and any output from the alias
command will get sent to Preview. This is almost certainly not the original intention for the alias, but it does explain why shells would launch Preview in the past and now produce errors.
The original author probably should have written:
alias pman 'man -t !^ | open -f -a /Applications/Preview.app/'
By surrounding the full command with single-quotes, the shell won’t process any of that text but will make it all part of the alias.
Of course, it still won’t work with modern versions of macOS.
Similarly, the tree
alias is similarly malformed. As written, the tree
alias will just call find . -type d
. Everything after the pipe character (intended to process the output of that find
command) gets executed as a part of alias-creation instead of being part of the alias command. But the expression includes single-quotes as well, which means any surrounding quotes also need special handling. This is probably what the original author intended:
alias tree "find . -type d | sed -e 1d -e 's/[^-][^/]*//–/g' -e 's/^/ /' -e 's/-/|-/'"
I suspect those last two lines (the pman
and tree
aliases) probably never worked as intended
Delete those lines. Or if you don’t want to lose the content, put a #
character at the start of the line (making it a comment-line, which won’t be executed)