Sample text file contains:
04/06/1991 06/05/2001 06/08/2015
cat ".sort.txt" | while IFS='/' read -r num inta intb intc;do
for i in "${ADDR[@]}";do
s=$inta+$intb+$intc
echo $s >> .sort.txt
done
done <<< "$IN"
Expecting the text file to become:
04/06/1991 06/05/2001 06/08/2015 2001 2012 2029
With bash:
Output: