I’m new to bash scripting, and I’m trying to output 2 columns of data. First column has
# vs # : Second column has correlation coefficient. I’m trying to output
1 vs 2 : 0.214213, with the comma at the end to a file, but it outputs as
1 vs 2 : ,0.214213 with the comma in the middle. This is the line of bash commands that I’m using:
echo -e -n "$i vs $((i+1)) :t" >> ./EEG_DATA/conc_corr_$conc.csv | corr ./EEG_DATA/ERP/ERP$conc/ERP$conc.$i.txt ./EEG_DATA/ERP/ERP$conc/ERP$conc.$((i+=1)).txt >> ./EEG_DATA/conc_corr_$conc.csv | echo -n ',' >>./EEG_DATA/conc_corr_$conc.csv
I’m not sure why the comma is being written in the middle when the command to
echo the comma is at the end of the line. Any help is greatly appreciated.