2

The command alias lists the active aliases. But it does this in a way that is different from how to set the alias:

% alias foo 'bar \!*'
% alias baz quux xyzzy
% alias corge 'grault \
garply  (quux xyzzy)'
% alias
baz     (quux xyzzy)
corge   grault 
garply  (quux xyzzy)
foo     bar !*

How can I convert the existing aliases to the commands that would build the alias (sort of the command alias but in reverse)?

1 Answer 1

2

AFAIK, there is no way to do this in csh or tcsh.

POSIX compatible alias implementations (e.g. those in ksh or the Bourne Shell) offer "alias -p" to list aliases in a way that allows the result to be fed into the shell again.

You may try to switch to a different shell or to ask the maintainers of csh (this would be rather tcsh) to add support for alias -p.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .