# Variable

This option allows you to define bash variables that will be accessible in your script and its subcommands. While it's possible to define variables directly within your bash script, this feature provides a structured alternative by enabling you to centralize variable definitions in the YAML configuration file.

This approach helps to organize your variables separately from the main script logic, improving readability and maintainability. It is important to note that using this option is optional, and you can continue to define variables directly in your bash script if preferred.

bashly.yml
variables:
  # Simple value
  - name: output_folder
    value: output

  # Array
  - name: download_sources
    value:
    - youtube
    - instagram

  # Associative array
  - name: zip_options
    value:
      pattern: "*.json"
      compression_level: fast

Variables Example

# Basic Options

# name

String Required

The name of the variable.

# value

Any Type

The variable's value can be a simple type such as a string, number, or boolean, or a one-level complex structure like an array or associative array (hash).