Skip to content

Instantly share code, notes, and snippets.

@jccorrea
Created March 25, 2017 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jccorrea/08f9a2928af6af8483df9dda12e9b447 to your computer and use it in GitHub Desktop.
Save jccorrea/08f9a2928af6af8483df9dda12e9b447 to your computer and use it in GitHub Desktop.
append header to text file . by Dennis Williamson
echo 'task goes here' | cat - todo.txt > temp && mv temp todo.txt
or
sed -i '1s/^/task goes here\n/' todo.txt
or
sed -i '1itask goes here' todo.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment