I am writing a bash script which will read a CSV file and print the result in console with some string concatenation.
I am facing one issue with one string overwriting part of another when concatenating them in a bash script. Below is the whole code given and I am running it in Gitbash installed on my windows.
CSV File1 with two rows is given below
Apple,Cycle
Orange,Lamborgini
Script:
while IFS=, read -r x y
do
fruit=$x
vehicle=$y
echo "$y ran"
done < File1.csv
Actual Output:
ranle
ranborgini
Expected Output:
Cycle ran
Lamborgini ran