Redirection is all that is needed to create a CSV file in a bash shell script. In this example, a CSV file named example.csv is created, and the text Hello World will be in cell A1 of the CSV file.
~]# echo "Hello World" > example.csv
The data in a CSV file is often separated by a comma. Simply placing a comma between Hello and World will separated the data with a comma.
~]# echo "Hello,World" > example.csv
The column command can be used to create a tab separated CSV file. In this example, the data in the example.csv file is comma separated, and then a new CSV file named tab.csv is created.
~]# column -t example.csv > tab.csv