How can I auto-close an urxvt terminal after executing an expect script?
up vote
0
down vote
favorite
I've written a script to handle quick copying of passwords to the clipboard:
#!/usr/bin/expect -f
spawn -noecho zsh
expect "$ "
send "pass show -c "
interact
exit
This script is launched like this:
urxvt -e /home/user/pass_script.sh
The script runs well, but after finishing, the spawned urxvt terminal needs to close. It doesn't do so as of now. How can I make sure it does?
command-line scripts automation expect rxvt
add a comment |
up vote
0
down vote
favorite
I've written a script to handle quick copying of passwords to the clipboard:
#!/usr/bin/expect -f
spawn -noecho zsh
expect "$ "
send "pass show -c "
interact
exit
This script is launched like this:
urxvt -e /home/user/pass_script.sh
The script runs well, but after finishing, the spawned urxvt terminal needs to close. It doesn't do so as of now. How can I make sure it does?
command-line scripts automation expect rxvt
1
does it auto close for other commands likeurxvt -e sleep 5
? if yes, tryurxvt -e expect -d /home/user/pass_script.sh
and see what's the problem.
– pynexj
Nov 27 at 13:51
That code is fine. The problem, I'm guessing, is what thepass
command does after you hit enter. Does it ever end?
– glenn jackman
Nov 27 at 18:14
@pynexj: yes, it does close after runningurxvt -e sleep 5
. running with debug flag doesn't show me what goes wrong; the script will just copy my password to clipboard and return with a new prompt (instead of exiting). @glenn jackman: well, I have to add my desired password ID after the already entered"pass show -c "
. After entering my ID, zsh will return with a prompt instead of exiting.
– Exeleration-G
Nov 27 at 18:38
just replaceinteract
withexpect "$ "
– pynexj
Nov 28 at 3:36
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've written a script to handle quick copying of passwords to the clipboard:
#!/usr/bin/expect -f
spawn -noecho zsh
expect "$ "
send "pass show -c "
interact
exit
This script is launched like this:
urxvt -e /home/user/pass_script.sh
The script runs well, but after finishing, the spawned urxvt terminal needs to close. It doesn't do so as of now. How can I make sure it does?
command-line scripts automation expect rxvt
I've written a script to handle quick copying of passwords to the clipboard:
#!/usr/bin/expect -f
spawn -noecho zsh
expect "$ "
send "pass show -c "
interact
exit
This script is launched like this:
urxvt -e /home/user/pass_script.sh
The script runs well, but after finishing, the spawned urxvt terminal needs to close. It doesn't do so as of now. How can I make sure it does?
command-line scripts automation expect rxvt
command-line scripts automation expect rxvt
asked Nov 27 at 11:18
Exeleration-G
4,181104487
4,181104487
1
does it auto close for other commands likeurxvt -e sleep 5
? if yes, tryurxvt -e expect -d /home/user/pass_script.sh
and see what's the problem.
– pynexj
Nov 27 at 13:51
That code is fine. The problem, I'm guessing, is what thepass
command does after you hit enter. Does it ever end?
– glenn jackman
Nov 27 at 18:14
@pynexj: yes, it does close after runningurxvt -e sleep 5
. running with debug flag doesn't show me what goes wrong; the script will just copy my password to clipboard and return with a new prompt (instead of exiting). @glenn jackman: well, I have to add my desired password ID after the already entered"pass show -c "
. After entering my ID, zsh will return with a prompt instead of exiting.
– Exeleration-G
Nov 27 at 18:38
just replaceinteract
withexpect "$ "
– pynexj
Nov 28 at 3:36
add a comment |
1
does it auto close for other commands likeurxvt -e sleep 5
? if yes, tryurxvt -e expect -d /home/user/pass_script.sh
and see what's the problem.
– pynexj
Nov 27 at 13:51
That code is fine. The problem, I'm guessing, is what thepass
command does after you hit enter. Does it ever end?
– glenn jackman
Nov 27 at 18:14
@pynexj: yes, it does close after runningurxvt -e sleep 5
. running with debug flag doesn't show me what goes wrong; the script will just copy my password to clipboard and return with a new prompt (instead of exiting). @glenn jackman: well, I have to add my desired password ID after the already entered"pass show -c "
. After entering my ID, zsh will return with a prompt instead of exiting.
– Exeleration-G
Nov 27 at 18:38
just replaceinteract
withexpect "$ "
– pynexj
Nov 28 at 3:36
1
1
does it auto close for other commands like
urxvt -e sleep 5
? if yes, try urxvt -e expect -d /home/user/pass_script.sh
and see what's the problem.– pynexj
Nov 27 at 13:51
does it auto close for other commands like
urxvt -e sleep 5
? if yes, try urxvt -e expect -d /home/user/pass_script.sh
and see what's the problem.– pynexj
Nov 27 at 13:51
That code is fine. The problem, I'm guessing, is what the
pass
command does after you hit enter. Does it ever end?– glenn jackman
Nov 27 at 18:14
That code is fine. The problem, I'm guessing, is what the
pass
command does after you hit enter. Does it ever end?– glenn jackman
Nov 27 at 18:14
@pynexj: yes, it does close after running
urxvt -e sleep 5
. running with debug flag doesn't show me what goes wrong; the script will just copy my password to clipboard and return with a new prompt (instead of exiting). @glenn jackman: well, I have to add my desired password ID after the already entered "pass show -c "
. After entering my ID, zsh will return with a prompt instead of exiting.– Exeleration-G
Nov 27 at 18:38
@pynexj: yes, it does close after running
urxvt -e sleep 5
. running with debug flag doesn't show me what goes wrong; the script will just copy my password to clipboard and return with a new prompt (instead of exiting). @glenn jackman: well, I have to add my desired password ID after the already entered "pass show -c "
. After entering my ID, zsh will return with a prompt instead of exiting.– Exeleration-G
Nov 27 at 18:38
just replace
interact
with expect "$ "
– pynexj
Nov 28 at 3:36
just replace
interact
with expect "$ "
– pynexj
Nov 28 at 3:36
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1096456%2fhow-can-i-auto-close-an-urxvt-terminal-after-executing-an-expect-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
does it auto close for other commands like
urxvt -e sleep 5
? if yes, tryurxvt -e expect -d /home/user/pass_script.sh
and see what's the problem.– pynexj
Nov 27 at 13:51
That code is fine. The problem, I'm guessing, is what the
pass
command does after you hit enter. Does it ever end?– glenn jackman
Nov 27 at 18:14
@pynexj: yes, it does close after running
urxvt -e sleep 5
. running with debug flag doesn't show me what goes wrong; the script will just copy my password to clipboard and return with a new prompt (instead of exiting). @glenn jackman: well, I have to add my desired password ID after the already entered"pass show -c "
. After entering my ID, zsh will return with a prompt instead of exiting.– Exeleration-G
Nov 27 at 18:38
just replace
interact
withexpect "$ "
– pynexj
Nov 28 at 3:36