paradox870
paradox870

Reputation: 2202

Pipe input to unix process knowing PID from command line

Is there a way, from the command line utility in unix (more specifically linux) to pipe input to a process knowing it's PID. For example, I start a Python process in the background, and keep track of the PID. Then, using the PID, and the command line, decide to execute "print 'Hello World'", and wish to receive the output to my terminal. Is it possible to do this?

Upvotes: 1

Views: 763

Answers (1)

dvanaria
dvanaria

Reputation: 6783

On Linux, you can use the 'jobs' command to get the job number of the program you put into the background.

Then you can use the 'fg' command to bring that program to the foreground.

Say your python program is job 3. Calling 'fg 3' will bring the program to the foreground.

Not sure if this is what you're looking for. If not, it might help to elaborate on your example.

Upvotes: 1

Related Questions