I used to execute the command:
sudo -u elasticsearch -s "ulimit -Hn"
and it was returning the value of ulimit -Hn as seen by user elasticsearch until I tried it on Ubuntu 11.10. There it returns:
/bin/bash: ulimit -Hn: command not found
I tried a few different commands, and when I use an argument I always get "command not found":
$ sudo -u elasticsearch -s "ls all.sh" /bin/bash: ls all.sh: command not found
Any ideas on how can I execute a command that requires arguments through