How to join a list with proper delimiter using shell script & tools?
E.g., given,
$ seq 3
1
2
3
The seq 3 | list_join will produce 1,2,3, without the trailing ,.
The seq is just a sample input, the actual input can come from anywhere and there should be no assumption on the input content/format except each ends with a new line.
UPDATE:
I asked for "shell script & tools" so I'm accepting the current shell script solution, although I personally would use Fravadona's solution:
$ jot -w 'Entry %c' 5 'A' | tee /dev/tty | paste -s -d ','
Entry A
Entry B
Entry C
Entry D
Entry E
Entry A,Entry B,Entry C,Entry D,Entry E