Bash scripts run in a different session than the session you are using to invoke that command, so, any temporary changes to state you make, like alias, apply only to that session, but once you leave the script, they are forgotten. Kind of like how state is forgotten when you leave scope in a function.
Recursively renaming ls with a custom ls is bad form. It assumes you are the only one that uses ls on your machine, which isn't a safe assumption. There might be a process which is expecting ls to run as expected and you could be messing up expected output for grok, for example.
Source: Look up my username.
I remember you from voat! We never spoke there though.
Is the shell's rc really considered a script? I know the rc can use shell script to configure it, but I thought bash understands that the rc is a config and not a .sh.
Also, doesn't the 'command' portion of the alias/function tell the shell not to see the alias/function recursively? I read that somewhere but trying to look into how 'command' works through a search engine pulls up all kinds of uselessness. 'apropos' is useless too. Can you point me to some documentation on that?
In Unix, everything is a script. That's the beauty of Unix philosophy.
.bashrc is run as
$ ./.bashrc
NOT
$ source .bashrc
NOT
$ . .bashrc
Etc...
The difference is not trivial as script kiddies may assume. For more information RTFM
$ man command
Oh yeah, for got to mention 'man' too:
No manual entry for command
(post is archived)