You are not logged in.
Pages: 1
Hi,
I'm trying to stop (nicely) a xterm running a ncmpc from another termial. For scrpiting purposes.
So i thought it would be enought to send a 'q' character trought stdin.
this is what i'm testing
pc -C ncmpc # to grab the PID
once i've got the PID i try
echo -n q > /proc/PID/fd/0
but the progrma doesn't exits. (it prints the q on stdout)
Could somebody give advice on how to do this?
1) is this the best way ?(maybe kill -STOP PID is not bad if ncmpc handles it well)
2) or how do i echo the q?
regards
.--.-.... --. .-.-.-..-.-..--....- .- .-...-... --..-..-... -.-.----. ..-.. ...------....-...-.-----..-- .-....---.-..- --. .-.-.-..-.-.--- .-...-... --..-..-... -.-.----. .-...- -......-...-...-..-..-
Offline
I asked a question similar to this awhile ago
http://bbs.archlinux.org/viewtopic.php?id=36103
For scripting you are better off to kill based on a PID (its cleaner to code, works every time, and more portable then the other option)
I am still interested if the redirect would work, you may want to post on a BSD forum as well (those folks have a wealth of knowledge as well)
Offline
Pages: 1