# exec

Execute a command in the running container.

```rhai
container.exec(command) -> CommandResult
```

## Parameters

- `command` (string): Command to execute in the container

## Returns

Returns a `CommandResult` with the command output.

## Examples

```rhai
let container = nerdctl_container_from_image("web", "nginx:latest")
    .build();
    
container.start();

// Execute commands in the container
let result = container.exec("ls -la /usr/share/nginx/html");
print(result.stdout);

let result2 = container.exec("nginx -v");
print(result2.stderr);  // nginx outputs version to stderr
```

## Notes

- Container must be running
- Returns stdout, stderr, and exit code
- Useful for debugging and maintenance
