Using bash, is it possibile to send the equivalent of a space bar stroke to a process? If so, how can that be done?
Edit to clarify a bit what I want to achieve: let’s say I’ve got an mplayer process running and I want to pause the execution of the current song, how would I achieve this?
You can direct standard I/O to it. If you are using Bash, then you probably have other GNU tools. GNU Coreutils has an
echocommand that can output pretty much anything. For example:However if you need an actual TTY (terminal) and you have more sophisticated requirements, look into expect, which can do nearly anything a human can (except think).