Artificial intelligent assistant

Is nice ignoring aliases? I have `alias rm='rm -i'` in my `~/.bashrc` file (I've just learned it is considered bad practice by some). It seems the alias is not taken into account when running it with `nice`: bli@naples:~$ touch test bli@naples:~$ rm test rm: remove regular empty file 'test'? n bli@naples:~$ nice rm test bli@naples:~$ Why is that so?

By default, `nice` is an external command:


$ command -v nice
/usr/bin/nice


This means it has no knowledge of aliases, which are a shell feature:


$ alias foo='echo hello'
$ foo
hello
$ nice foo
nice: foo: No such file or directory


However there is a feature of the shell that allows aliases to _also_ expand further aliases. You end the expansion with a space.


$ alias nice='/usr/bin/nice '


Spot that space at the end; it's important.

Now...


$ nice foo
hello
$ command -v nice
alias nice='/usr/bin/nice '


Any external command can be wrapped with an alias like this if you want the shell to do alias expansion.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy e481d25819234ea980140bedb9dedf3c