FunctionRacerProblemsRace

Swap Two Columns

MediumBasha shell script

Each line of pairs.csv is two words with a comma between them, like ada,boston. Print every line with the two swapped: boston,ada.

Example 1

pairs.csv
ada,boston
ben,miami
prints
boston,ada
miami,ben

Constraints

Race itor take your time

Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.

More Bash problems