Questions tagged [snippet]
4 questions
10
votes
5 answers
Bash snippet for killing a process until it's dead?
I'm trying to write a robust bash script, and in it I create a background process. At the end of the script, I want to kill it. I have it's PID.
I was thinking of somthing like this
while [[ ps ef $PID ]] ; do
kill $PID
sleep 0.5
done
Any…

Amandasaurus
- 31,471
- 65
- 192
- 253
4
votes
6 answers
Bash snippet to see if something is listening on a port?
I want to see if something is listening on a port on localhost. I was going to use nc and check the exit code.
Something like this:
echo "" | nc localhost 14881
echo $?
Any other suggestions?

Amandasaurus
- 31,471
- 65
- 192
- 253
0
votes
2 answers
Bash snippet for apache error log to show what URLS are causing 404s?
I have a standard apache error log file. I would like to see what URLs are causing 404s, since I have moved this site around and I want to find bad links. Can anyone recommend a bash snippet that will parse this log using awk or something to show me…

Amandasaurus
- 31,471
- 65
- 192
- 253
0
votes
2 answers
Best CMS to handle short snippets of text?
I have to install a CMS to manage a set of mathematical problems, i.e., our main content will be short (~3 lines) snippets of text. We need the ability to add comments and categories/tags, possibly with a powerful search function combining different…
Federico Poloni