In Bash this will set a time limit of 10 seconds for the slowcommand
timeout 10 slowcommand
I'm wondering how I could get the same behavior, if I had to call sudo in order to run slowcommand, i.e.:
timeout 10 sudo slowcommand
This will timelimit on sudo, not on the slowcommand... Is there an elegant way to do this while using sudo?
Edit: Let's assume timeout is not permitted to be run with sudo.