Hola Oriol
To execute a system command from PixInsight's console, prepend an exclamation sign (!) to it.
For example, you can try:
!ls
to run the ls program (not PI's ls internal command, which is different).
On Windows, system commands must be executed via the "cmd" program. For example:
!cmd /c dir
would run the DIR command (the "equivalent" to ls on Windows).
You can use conditional directives to write code that runs on all supported platforms:
#ifeq __PI_PLATFORM__ MSWINDOWS
# define LS !cmd /c dir
#else
# define LS !ls -l
#endif
__PI_PLATFORM__ is a predefined macro that is always available to any script in PixInsight. Note that on Mac OS X you actually have a UNIX platform, so we have to care about Windows only. Hope this helps.
As David says, to execute commands from a script you need to enable the corresponding security settings. Don't expect your users to be too happy of having to do this, though. What are you doing that can't be done with the File object?
By the way, interesting project