I want to run a shell script with time limit of 50s.Below work fine in linux.

  timeout 50s sudo sh my-script.sh

But i have AIX server where i want to run above script with time limit of 50 seconds.So i run same command in AIX but it gives me

     timeout command not found

Is there similar timeout command in AIX ?


Probably you were using timeout from GNU coreutils. You can install that from AIX Toolbox for Linux, or a third party source, or compile it yourself.

Or, Perl can schedule a SIGALRM. Several CPAN modules have examples of timeouts, and signal handling in general. Perl should be a bit more portable, may be useful if this is not the only platform difference that annoys you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.