How do I get the prompt back when running `at' from terminalWhy do I need to hit enter to get my shell prompt after my init.d script completes?Why do I need to hit enter to get my shell prompt after my init.d script completes?How do I read the output of commands in a scriptUnable to get back to bash prompt after strange commandbash script locked at if statement when executedbash - get pid for a script using the script filenameHow do I run a command in a new terminal window in the same process as the original?bash program to execute something when keyword seen on stdinWhy does my Cygwin Bash always read from terminal when I try to execute an external command?echo $HISTSIZE not printing when executed via shell script but works in command lineCron jobs monitoring using exit code
Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?
PTIJ: Sport in the Torah
Propulsion Systems
I am the person who abides by rules but breaks the rules . Who am I
Paper published similar to PhD thesis
Is the differential, dp, exact or not?
Should I file my taxes? No income, unemployed, but paid 2k in student loan interest
What does it take to become a wilderness skills guide as a business?
What is Tony Stark injecting into himself in Iron Man 3?
Does an unused member variable take up memory?
Having the player face themselves after the mid-game
Who has more? Ireland or Iceland?
Should we avoid writing fiction about historical events without extensive research?
Professor forcing me to attend a conference, I can't afford even with 50% funding
What can I do if someone tampers with my SSH public key?
How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?
Tool for measuring readability of English text
Unidentified signals on FT8 frequencies
Rationale to prefer local variables over instance variables?
How do you make a gun that shoots melee weapons and/or swords?
Help! My Character is too much for her story!
Why does this boat have a landing pad? (SpaceX's GO Searcher) Any plans for propulsive capsule landings?
Why restrict private health insurance?
I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?
How do I get the prompt back when running `at' from terminal
Why do I need to hit enter to get my shell prompt after my init.d script completes?Why do I need to hit enter to get my shell prompt after my init.d script completes?How do I read the output of commands in a scriptUnable to get back to bash prompt after strange commandbash script locked at if statement when executedbash - get pid for a script using the script filenameHow do I run a command in a new terminal window in the same process as the original?bash program to execute something when keyword seen on stdinWhy does my Cygwin Bash always read from terminal when I try to execute an external command?echo $HISTSIZE not printing when executed via shell script but works in command lineCron jobs monitoring using exit code
Perhaps this is more of a general question on scripting and terminal use than of the use of the `at' command. Regardless, I am exploring the use of the at command to get a handle on its behavior and how I can control it before I use it for a serious script.
I wrote a trivial script named at-test.sh, saved it to $HOME and made it executable:
#!/bin/sh
echo $(date +%H:%M:%s) > /dev/pts/9
exit 0
then ran it via
at -f './at-test.sh' now + 1 minutes
It runs as expected, but I must Ctrl+C to get the shell prompt back. I later learned that the Enter key would work also to get the prompt back.
Is there anyway to get the prompt back via a command in the script?
shell-script terminal at
New contributor
add a comment |
Perhaps this is more of a general question on scripting and terminal use than of the use of the `at' command. Regardless, I am exploring the use of the at command to get a handle on its behavior and how I can control it before I use it for a serious script.
I wrote a trivial script named at-test.sh, saved it to $HOME and made it executable:
#!/bin/sh
echo $(date +%H:%M:%s) > /dev/pts/9
exit 0
then ran it via
at -f './at-test.sh' now + 1 minutes
It runs as expected, but I must Ctrl+C to get the shell prompt back. I later learned that the Enter key would work also to get the prompt back.
Is there anyway to get the prompt back via a command in the script?
shell-script terminal at
New contributor
That's odd.at
should immediately go to the background. What version ofat
is this (at -V
)? What operating system? If Enter works, what else do you need?
– terdon♦
4 hours ago
@terdon - at version 3.1.14 running on LinuxMint 17. I just read this [link] (unix.stackexchange.com/a/4230/340857) which is exactly what is happening. I guess it is of no consequence really, I just thought it was odd behavior. My ultimate plan is to use it to end public computer sessions by timing out, then forcing logoff, so that behavior is probably ok.
– cdaaawg
3 hours ago
add a comment |
Perhaps this is more of a general question on scripting and terminal use than of the use of the `at' command. Regardless, I am exploring the use of the at command to get a handle on its behavior and how I can control it before I use it for a serious script.
I wrote a trivial script named at-test.sh, saved it to $HOME and made it executable:
#!/bin/sh
echo $(date +%H:%M:%s) > /dev/pts/9
exit 0
then ran it via
at -f './at-test.sh' now + 1 minutes
It runs as expected, but I must Ctrl+C to get the shell prompt back. I later learned that the Enter key would work also to get the prompt back.
Is there anyway to get the prompt back via a command in the script?
shell-script terminal at
New contributor
Perhaps this is more of a general question on scripting and terminal use than of the use of the `at' command. Regardless, I am exploring the use of the at command to get a handle on its behavior and how I can control it before I use it for a serious script.
I wrote a trivial script named at-test.sh, saved it to $HOME and made it executable:
#!/bin/sh
echo $(date +%H:%M:%s) > /dev/pts/9
exit 0
then ran it via
at -f './at-test.sh' now + 1 minutes
It runs as expected, but I must Ctrl+C to get the shell prompt back. I later learned that the Enter key would work also to get the prompt back.
Is there anyway to get the prompt back via a command in the script?
shell-script terminal at
shell-script terminal at
New contributor
New contributor
edited 4 hours ago
cdaaawg
New contributor
asked 4 hours ago
cdaaawgcdaaawg
62
62
New contributor
New contributor
That's odd.at
should immediately go to the background. What version ofat
is this (at -V
)? What operating system? If Enter works, what else do you need?
– terdon♦
4 hours ago
@terdon - at version 3.1.14 running on LinuxMint 17. I just read this [link] (unix.stackexchange.com/a/4230/340857) which is exactly what is happening. I guess it is of no consequence really, I just thought it was odd behavior. My ultimate plan is to use it to end public computer sessions by timing out, then forcing logoff, so that behavior is probably ok.
– cdaaawg
3 hours ago
add a comment |
That's odd.at
should immediately go to the background. What version ofat
is this (at -V
)? What operating system? If Enter works, what else do you need?
– terdon♦
4 hours ago
@terdon - at version 3.1.14 running on LinuxMint 17. I just read this [link] (unix.stackexchange.com/a/4230/340857) which is exactly what is happening. I guess it is of no consequence really, I just thought it was odd behavior. My ultimate plan is to use it to end public computer sessions by timing out, then forcing logoff, so that behavior is probably ok.
– cdaaawg
3 hours ago
That's odd.
at
should immediately go to the background. What version of at
is this (at -V
)? What operating system? If Enter works, what else do you need?– terdon♦
4 hours ago
That's odd.
at
should immediately go to the background. What version of at
is this (at -V
)? What operating system? If Enter works, what else do you need?– terdon♦
4 hours ago
@terdon - at version 3.1.14 running on LinuxMint 17. I just read this [link] (unix.stackexchange.com/a/4230/340857) which is exactly what is happening. I guess it is of no consequence really, I just thought it was odd behavior. My ultimate plan is to use it to end public computer sessions by timing out, then forcing logoff, so that behavior is probably ok.
– cdaaawg
3 hours ago
@terdon - at version 3.1.14 running on LinuxMint 17. I just read this [link] (unix.stackexchange.com/a/4230/340857) which is exactly what is happening. I guess it is of no consequence really, I just thought it was odd behavior. My ultimate plan is to use it to end public computer sessions by timing out, then forcing logoff, so that behavior is probably ok.
– cdaaawg
3 hours ago
add a comment |
1 Answer
1
active
oldest
votes
You've successfully submitted the at
job and it has successfully printed the date to (your) terminal at /dev/pts/9
. You also have a shell there that has printed a prompt and is duly waiting for your input.
This is a simulation of what happened:
your-prompt-here$ at -f './at-test.sh' now + 1 minutes
job 1 at Fri Mar 8 20:13:00 2019
your-prompt-here$
... one minute passes; resume the demonstration
your-prompt-here$ 20:14:1552093897
echo I am still here
I am still here
your-prompt-here$
As you can see, my shell accepted the echo
command; my cursor simply wasn't where I "expected" it to be because the at
job scribbled onto my terminal.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
cdaaawg 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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f505245%2fhow-do-i-get-the-prompt-back-when-running-at-from-terminal%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You've successfully submitted the at
job and it has successfully printed the date to (your) terminal at /dev/pts/9
. You also have a shell there that has printed a prompt and is duly waiting for your input.
This is a simulation of what happened:
your-prompt-here$ at -f './at-test.sh' now + 1 minutes
job 1 at Fri Mar 8 20:13:00 2019
your-prompt-here$
... one minute passes; resume the demonstration
your-prompt-here$ 20:14:1552093897
echo I am still here
I am still here
your-prompt-here$
As you can see, my shell accepted the echo
command; my cursor simply wasn't where I "expected" it to be because the at
job scribbled onto my terminal.
add a comment |
You've successfully submitted the at
job and it has successfully printed the date to (your) terminal at /dev/pts/9
. You also have a shell there that has printed a prompt and is duly waiting for your input.
This is a simulation of what happened:
your-prompt-here$ at -f './at-test.sh' now + 1 minutes
job 1 at Fri Mar 8 20:13:00 2019
your-prompt-here$
... one minute passes; resume the demonstration
your-prompt-here$ 20:14:1552093897
echo I am still here
I am still here
your-prompt-here$
As you can see, my shell accepted the echo
command; my cursor simply wasn't where I "expected" it to be because the at
job scribbled onto my terminal.
add a comment |
You've successfully submitted the at
job and it has successfully printed the date to (your) terminal at /dev/pts/9
. You also have a shell there that has printed a prompt and is duly waiting for your input.
This is a simulation of what happened:
your-prompt-here$ at -f './at-test.sh' now + 1 minutes
job 1 at Fri Mar 8 20:13:00 2019
your-prompt-here$
... one minute passes; resume the demonstration
your-prompt-here$ 20:14:1552093897
echo I am still here
I am still here
your-prompt-here$
As you can see, my shell accepted the echo
command; my cursor simply wasn't where I "expected" it to be because the at
job scribbled onto my terminal.
You've successfully submitted the at
job and it has successfully printed the date to (your) terminal at /dev/pts/9
. You also have a shell there that has printed a prompt and is duly waiting for your input.
This is a simulation of what happened:
your-prompt-here$ at -f './at-test.sh' now + 1 minutes
job 1 at Fri Mar 8 20:13:00 2019
your-prompt-here$
... one minute passes; resume the demonstration
your-prompt-here$ 20:14:1552093897
echo I am still here
I am still here
your-prompt-here$
As you can see, my shell accepted the echo
command; my cursor simply wasn't where I "expected" it to be because the at
job scribbled onto my terminal.
answered 3 hours ago
Jeff SchallerJeff Schaller
43.1k1159138
43.1k1159138
add a comment |
add a comment |
cdaaawg is a new contributor. Be nice, and check out our Code of Conduct.
cdaaawg is a new contributor. Be nice, and check out our Code of Conduct.
cdaaawg is a new contributor. Be nice, and check out our Code of Conduct.
cdaaawg is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f505245%2fhow-do-i-get-the-prompt-back-when-running-at-from-terminal%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
That's odd.
at
should immediately go to the background. What version ofat
is this (at -V
)? What operating system? If Enter works, what else do you need?– terdon♦
4 hours ago
@terdon - at version 3.1.14 running on LinuxMint 17. I just read this [link] (unix.stackexchange.com/a/4230/340857) which is exactly what is happening. I guess it is of no consequence really, I just thought it was odd behavior. My ultimate plan is to use it to end public computer sessions by timing out, then forcing logoff, so that behavior is probably ok.
– cdaaawg
3 hours ago