Knowing when bash is done running a command through a FIFO pipe
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
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
Hello World!
Terminal 2
$ echo "Hello World!" > 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?
bash pipe fifo
New contributor
add a comment |Â
up vote
0
down vote
favorite
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
Hello World!
Terminal 2
$ echo "Hello World!" > 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?
bash pipe fifo
New contributor
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
Hello World!
Terminal 2
$ echo "Hello World!" > 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?
bash pipe fifo
New contributor
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
Hello World!
Terminal 2
$ echo "Hello World!" > 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?
bash pipe fifo
bash pipe fifo
New contributor
New contributor
New contributor
asked 7 mins ago
Kirk122
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Kirk122 is a new contributor. Be nice, and check out our Code of Conduct.
Kirk122 is a new contributor. Be nice, and check out our Code of Conduct.
Kirk122 is a new contributor. Be nice, and check out our Code of Conduct.
Kirk122 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479052%2fknowing-when-bash-is-done-running-a-command-through-a-fifo-pipe%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password