2

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 ?

AWS_Beginner
  • 181
  • 5

1 Answers1

5

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.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34