Get information about the operating system in shell scripts.
Prints the operating system platform as a lowercased string. Examples:
darwin
linux
windows
#!/usr/bin/env import
import "os"
os_platform
# linux
Prints the CPU architecture that the operating system is running on. Examples:
x86
x86_64
#!/usr/bin/env import
import "os"
os_arch
# x86_64
Adds an entry to the beginning of the $PATH
environment variable.
#!/usr/bin/env import
import "os"
echo "\$PATH before: $PATH"
os_path_unshift "/foo/bin"
echo "\$PATH after: $PATH"
Adds an entry to the end of the $PATH
environment variable.
#!/usr/bin/env import
import "os"
echo "\$PATH before: $PATH"
os_path_push "/foo/bin"
echo "\$PATH after: $PATH"