2
1
in order to run a certain command I need to use
sudo -h -u someuser <somecommand>
in order to save some sanity I created an alias
alias somecommand='function _dm(){ sudo -u ubuntu somecommand $@; };_dm'
This works great until I try and do something fancy.
somecommand arg1 | xargs somecommand arg2
This causes me problems since xargs doesn't invoke the alias. Is it possible to make this work somehow?
1I'm not sure why you're wrapping a function inside the alias, if you could just use the same function directly? [not that it'd help with xargs but still] – user1686 – 2015-10-11T00:51:19.850