If I have the following line in .bash_profile:
alias j="ls -ltr"
Then I type j
at the command prompt, the output is as expected. But if I put the alias command in a separate file, and source it from .bash_profile:
source ./aliases
or
. ./aliases
Then type j
at the command prompt, the output is:
's: invalid option -- '
Try 'ls --help' for more information.
I have tried various ways of quoting and escaping. I do not know why it is different when the alias command is sourced from a separate file. The output of uname -a
is:
Linux vbox4rhel 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 8 13:30:15 EST 2021 x86_64 x86_64 x86_64 GNU/Linux
I would like to know what is different when the alias command is in a separate file that is sourced. Thanks.