# Sys

The Sys class provides low-level access to various system functions.

```ruby
Sys.run("cmd")        # execute a command
Sys.osname            # name of operating system
Sys.sidef             # path to sidef executable

Sys.kill(:KILL, pid)  # send a "KILL" signal to pid
Sys.fork              # fork the self program
Sys.wait              # wait for a child process to finish

Sys.alarm(n)          # set alarm for n seconds
Sys.sleep(3.5)        # sleep 3.5 seconds
Sys.exit(2)           # exit the program with code 2

Sys.read(TYPE)        # read a type of data from STDIN
Sys.read(msg, TYPE)   # read a type of data from STDIN, with prompt
Sys.scanln(msg)       # read a String line from STDING, with prompt

Sys.refaddr(obj)      # internal reference address of an object
Sys.reftype(obj)      # internal reference type name of an object

Sys.eval(code)        # evaluate arbitrary Perl code
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trizen.gitbook.io/sidef-lang/syntax_and_semantics/literals/sys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
