There is a acc.csv file, that contains name and surname in 3rd column (ex: john smith). I try capitalize firt letters (John Smith) and create a new file acc_new.csv with this:
#!/bin/bash
while IFS=, read -r col1 col2 col3
do
for n in $col3; do
n=${n^}
done
done < acc.csv > acc_new.csv
But acc_new.csv is empty. What is wrong with code?
acc.csv:
id,location,name
1,1,john smith
2,2,paul Robinson
3,3,Fidel guererro
...
expected output:
id,location,name
1,1,John Smith
2,2,Paul Robinson
3,3,Fidel Guererro
...