Open spiralofhope opened 4 years ago
Drawn from https://stackoverflow.com/a/51052644/1190568
string='example' __="$string" while [ -n "$__" ]; do # All but the first character of the string rest="${__#?}" # Remove $rest, and you're left with the first character first_character="${__%"$rest"}" echo "$first_character" __="$rest" done
Drawn from https://stackoverflow.com/a/51052644/1190568