Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # USE: prepend <filename> "The string to prepend"
  4. # Works like echo "text" >> <filename>, but opposite
  5. # Useful for adding "# Project title" to the top of a new readme
  6.  
  7. tmp="temp".$(date +%s)
  8. echo "$2" > $tmp
  9. cat "$1" >> $tmp
  10. cat $tmp > "$1"
  11. rm $tmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement