Open and write data to text file using Bash?

Adnan picture Adnan · Jun 22, 2012 · Viewed 752.5k times · Source

How can I write data to a text file automatically by shell scripting in Linux?

I was able to open the file. However, I don't know how to write data to it.

Answer

Rocky Pulley picture Rocky Pulley · Jun 22, 2012
echo "some data for the file" >> fileName