3 ms·
I didn't know that! Why does it work?
by JadeNB 7y ago
I didn't know that! Why does it work?
- downerending 7y agoThe backslash basically means "ignore any aliases or functions by the same name, and run the first matching command in my $PATH instead". One reason for providing this is so that you can have an alias like alias mv '\mv -=myfavoritearg ' but it's also good for ensuring that you didn't pick up some distro nonsense.
- JadeNB 7y agoThanks! So '\' is special cased here—it's not some specific manifestation of a more general phenomenon of specialised escape-handling in the shell?
- downerending 7y agoIf I understand correctly, yes, that's how I'd describe it.
- a1369209993 7y ago> So '\' is special cased here No; quoting any part of the command name prevents alias expansion. Eg 'mv', "mv", 'm'v, m\v, etc all work.