Skip to content

Instantly share code, notes, and snippets.

@zot24
Created September 24, 2014 14:37
Show Gist options
  • Select an option

  • Save zot24/dd10fc5d0da873c243a8 to your computer and use it in GitHub Desktop.

Select an option

Save zot24/dd10fc5d0da873c243a8 to your computer and use it in GitHub Desktop.
Prepend line to file using sed on a Mac, this is only valid if the script already have some data in it
sed -i '' -e $'1i\\\n Here is my new top line' file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment