Created
November 11, 2015 13:13
-
-
Save macrat/92404fe1ecee1cabc559 to your computer and use it in GitHub Desktop.
シェルスクリプトでCGIカウンター的なやつ。flock便利!
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 | |
| file='count.log' | |
| flock ${file} sh -c "expr `cat ${file} 2>/dev/null` + 1 >${file}; echo -e \"Content-Type: text/plain\n`cat ${file}`\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment