I am taking an input of elements from the user and displaying it in a file. However, I need to do one more task. I need to replace the first character of each array element with a dot(.) which is unfortunately not working for me.
Please find my code below:
while read line
do
my_array=("${my_array[@]}" $line)
done
echo ${my_array[@]/my_array[@][0]/.}
Any help would be highly appreciated, thanks.