Open jeffangelion opened 3 years ago
The trick is using ranges Example:
#!/usr/bin/env bash string="123456789" string_length=${#string} for ((index = 0 ; index < $string_length ; index++)); do echo $((${string:$index:1} * 10)) # we can use string as pseudo-array by setting range length to 1 done
The trick is using ranges Example: