Knowing when bash is done running a command through a FIFO pipe
2
votes
1
answer
250
views
I'm trying to link a web-based terminal with bash.
My current attempt to do so is spawning a shell pointing a FIFO pipe to its input, like this:
Terminal 1
$ mkfifo pipe
$ bash pipe
file1 file2 file4
Terminal 2
$ echo "ls" > pipe
As you might be able to tell, I am only getting command responses from spawning the shell in _Terminal 1_ (obviously). Is it possible for me to tell if bash is idle or not? I need to know when to show
$PS1
on the client side.
If I run something like apt-get install curl -y
, the command is continuous and finishes when it finishes. I need to know when it is finished so that on the front-end, I can show the terminal prompt.
Any ideas?
Asked by Kirk122
(21 rep)
Nov 1, 2018, 04:10 AM
Last activity: Oct 6, 2024, 07:38 AM
Last activity: Oct 6, 2024, 07:38 AM