write
cmd/write
Print or write formatted text
Overview
write prints formatted text to stdout, stderr, or a file.
Useful options:
--outchooses destination.--appendappends to files.--newlinecontrols trailing newline.
Example usage:
write "Hello %s" AvyOS
write "error: %s" timeout --out=stderr
write "uptime=%d" 42 --out=/tmp/status.txt --append
Usage
write <format> [args...] [--out=stdout|stderr|file] [--newline] [--append]
Flags
| Flag | Type | Description |
|---|---|---|
-append |
- |
Append to file instead of overwriting |
-newline |
- |
Add newline at end (default true) |
-out |
string |
Output destination: stdout, stderr, or filename (default "stdout") |
Exit Codes
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Runtime/command error |
2 |
Invalid flags/usage |