Created
February 2, 2012 12:36
-
-
Save bonifaido/1723274 to your computer and use it in GitHub Desktop.
Delete a line from a file with CLI
This file contains 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
#!/usr/bin/bash | |
if [ $# != 2 ] ; then | |
echo $0 [FILE] [LINENUMBER] | |
fi | |
{ rm $1 && awk '{ if (NR != DEL) print }' DEL=$2 > $1; } < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment