Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # USE: prepend <filename> "The string to prepend"
- # Works like echo "text" >> <filename>, but opposite
- # Useful for adding "# Project title" to the top of a new readme
- tmp="temp".$(date +%s)
- echo "$2" > $tmp
- cat "$1" >> $tmp
- cat $tmp > "$1"
- rm $tmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement