You're spot on Jean. Scripts stored in the repository run in a sandbox that prevents the code from doing anything dangerous (including things like calling Java APIs and, by extension, invoking OS commands / scripts) - this is to prevent users from uploading and running scripts that inadvertently or maliciously damage the system (or worse!).
That said, Alfresco v2.1.3 and above include a change that enables scripts stored wholely within the classpath to access native Java APIs (which allows all sorts of logic, including invocation of OS level commands / scripts). The reasoning here is that if a developer has sufficient privileges to manipulate the Alfresco classpath, there's not a lot Alfresco can do to prevent inadvertent / malicious damage to the system by that person (since they have direct filesystem access to the server).