#!/bin/bash array=(a b c d e f g) echo "${array[1]} ${#array[1]}" string="address@hidden:1:4}" echo "${string} ${#string}"
Produces:
address@hidden ycc# ./ascii
b 1 b c d e 7
I was expecting 'bcde' with a length of 4 after reading man bash. Why the spaces? I thought that possibly it was some IFS related issue so I set IFS='' on a separate statement but that changed nothing.