how to open application and after some time(time delay) automatically it should close
firefox | kill -9 `ps -A | grep firefox`
while using above command firefox opening and immediately it getting closed instead of that i need delay between opening and closing of application,i have alreay tried below command: firefox | sleep 5 | kill -9 `ps -A | grep firefox` |
Quote:
Code:
firefox & |
Might the last line be replaced with the shorter "pkill -9 firefox" or are there possible problems with this?
|
Why do you need to "kill -9"? A simple kill should work and will allow the process to terminate cleanly (save existing state, etc.) rather than just terminating it abruptly. It might be best to make sure you get the correct firefox PID, just in case there are multiple copies running (e.g. using different user accounts. A generic script to do this would be something like:
Code:
#!/bin/bash |
problem resolved
Quote:
|
All times are GMT -5. The time now is 11:22 PM. |