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