Created
November 28, 2012 17:25
-
-
Save leopic/4162690 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # add new content into the top of a file | |
| # @param1: content to be added | |
| # @param2: file where the content will be added | |
| TEMPFILE="tmp.txt" | |
| NEWCONTENT=$1 | |
| FILE=$2 | |
| (echo $NEWCONTENT; cat $FILE) > $TEMPFILE; mv $TEMPFILE $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment