# PreRunScript -- a way to impose resource limits

## Description

This option's value is a string containing a shell command that can impose any resource limits on the Macaulay2 process started by runExternalM2.

By default, it is set to the shell command

true

but you can set it to things like

ulimit -t 5

(to limit CPU time to 5 seconds) or something more complicated:

ulimit -S -m 654243 && ulimit -H -t 50

In all cases, it should be a single command such that appending

&& other_command

results in a valid shell command.

## See also

• RunExternalM2 -- a package to run Macaulay2 code externally and retrieve the result
• runExternalM2 -- run a Macaulay2 function in a new Macaulay2 process
• resource limits -- how to use resource limits with Macaulay2

## Functions with optional argument named PreRunScript :

• "runExternalM2(...,PreRunScript=>...)"

## For the programmer

The object PreRunScript is .