Files
You can easily read and write to files with bash.
You can write to a file with the following command :
Note: this overwrite the file.txt if it already exists.echo "things to write" > file.txt
If you want to append to file use the following command.If you want to a blank line, you needecho "things to appand" >> file.txt
echo -e
Remember that echo already ends with a newline character (even if you don't print one)echo "things to write" > file.txt echo -e "\n" >> file.txt echo "New line" >> file.txt
Read a file into a variable
You read the file test.txt into the variable testvalue.testvalue=`cat test.txt`
Those are backticks quotes not single quotes !Read file line by line
while read line do echo "This is a line : $line" done < $FILE