This question already has an answer here:
All the documentation I've looked at seems to indicate that in both aliases and shell functions, the name cannot contain spaces.
What I'm trying to do is make it more difficult for other admins (as root) to run a command against our Pass implementation (doc here : https://www.passwordstore.org/). It would still be possible, but I was hoping to turn a command like "pass rm $anyValueTheyInput" and alias that to, say "echo 'You can't do that'". Of course they're admins and they can change their aliases, but it would hopefully prevent accidental removal of passwords.
Is this possible in BASH? These will all be on RHEL or Centos boxes.
Aliasing whole commands complete with arguments is not possible in
bash
(if it's even possible in any UNIX shell at all).What you can do is create a
pass
function that catches all the undesirable argument packs and forwards all other argument packs tocommand pass
: