I am trying to read from a text file that i create using bash
<code>
#!/bin/bash
./apachectl stop
./apachectl start
ps -ef |grep httpd > tempFile
more tempFile
</code>
I want to be able to read the output from tempFile, look for pid and kill that pid using killall -9 <pid>
If it is possible, how?
tempFile
root 8711 1 0 15:02 ? 00:00:00 /usr/local/apache2/bin/httpd
nobody 8712 1 0 15:02 ? 00:00:00 /usr/local/apache2/bin/httpd
nobody 8713 1 0 15:02 ? 00:00:00 /usr/local/apache2/bin/httpd