to
Source code
This file contains functions for converting a value to a specific type
Index
to::string
Convert a value to a string
Example
Arguments
- $1 (any): value
Output on stdout
- The value as a string
to::boolean
Convert a value to a boolean
Example
Arguments
- $1 (any): value
Output on stdout
- The value as a boolean
to::int
Convert a value to an integer
Example
Arguments
- $1 (any): value
Exit codes
- 1: If the value is not an integer
Output on stdout
- The value as an integer
to::float
Convert a value to a float
Example
Arguments
- $1 (any): value
Exit codes
- 1: If the value is not a float
Output on stdout
- The value as a float
to::stdin
Convert the value '-' to stdin
Example
Arguments
- $1 (any): value
Output on stdout
- The value or stdin
to::file
Check if a value is a file
Example
Arguments
- $1 (any): value
Exit codes
- 1: If the value is not a file
Was this section helpful?