This question relates to the already asked question How to add text to beginning of file
The answer suggested by Dennis Williamson does the job:
echo 'task goes here' | cat - todo.txt > temp && mv temp todo.txt
In the above, the string
task goes here is added to the start of the file.
If the string
task goes here is in a file called
myfile.txt, then how should i change the command?
echo 'myfile.txt'... OR
echo myfile.txt... do not do the job.