Last active
August 29, 2015 14:19
-
-
Save sumitasok/b05ea4ec82a02a79836e to your computer and use it in GitHub Desktop.
Shell Script collection
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
# add a string in a field to line number (15) | |
perl -pi -e 'if($.==14){s/\n/\n\/\/ ABC\n/g}if(eof){$.=0}' Makefile.txt | |
# replace regex with environment variable | |
perl -pi -e 's/(([0-9]+.){3}([0-9]+))/'$dIPmysql'/g' t.sh |
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
# find the PID of the process that holds the port specified | |
lsof -i :7000 | awk 'FNR == 2 {print $2}' | |
lsof -i :8000 | awk 'FNR == 2 {print $2}' | xargs kill -9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment