You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ alias ls='ls -l'
$ ls # actually invokes `ls -l`
drwxr-xr-x 5 1000 1000 4096 Jun 9 05:25 dir1
drwx------ 3 1000 1000 4096 Jan 15 13:43 dir2
drwxrwxr-x 2 1000 1000 4096 Jan 15 13:42 dir3
drwxrwxr-x 3 1000 1000 4096 Sep 18 18:20 dir4
This is not currently possible in cash, since it looks like calling ls immediately invokes the builtin ls command (no options).
Also, when fixing this, we should make sure to test for the recursive case. If we use alias ls='ls -l', calling ls should invoke the alias, which invokes the builtin.
On the other hand, if we have something more complex:
$ alias ls='ls -l'
$ alias foo='ls'
$ foo # this ultimately invokes `ls -l`
We should make sure to evaluate aliases in such a way that they don't cause cycles.
The text was updated successfully, but these errors were encountered:
In bash and zsh, you can do aliases like this:
This is not currently possible in cash, since it looks like calling
ls
immediately invokes the builtinls
command (no options).Also, when fixing this, we should make sure to test for the recursive case. If we use
alias ls='ls -l'
, callingls
should invoke the alias, which invokes the builtin.On the other hand, if we have something more complex:
We should make sure to evaluate aliases in such a way that they don't cause cycles.
The text was updated successfully, but these errors were encountered: