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













1















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?










share|improve this question









New contributor




cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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















1















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?










share|improve this question









New contributor




cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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













1












1








1


1






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?










share|improve this question









New contributor




cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question









New contributor




cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 4 hours ago







cdaaawg













New contributor




cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









cdaaawgcdaaawg

62




62




New contributor




cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






cdaaawg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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

















  • 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
















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










1 Answer
1






active

oldest

votes


















1














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.






share|improve this answer






















    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.









    draft saved

    draft discarded


















    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









    1














    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.






    share|improve this answer



























      1














      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.






      share|improve this answer

























        1












        1








        1







        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.






        share|improve this answer













        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        Jeff SchallerJeff Schaller

        43.1k1159138




        43.1k1159138




















            cdaaawg is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Mobil Contents History Mobil brands Former Mobil brands Lukoil transaction Mobil UK Mobil Australia Mobil New Zealand Mobil Greece Mobil in Japan Mobil in Canada Mobil Egypt See also References External links Navigation menuwww.mobil.com"Mobil Corporation"the original"Our Houston campus""Business & Finance: Socony-Vacuum Corp.""Popular Mechanics""Lubrite Technologies""Exxon Mobil campus 'clearly happening'""Toledo Blade - Google News Archive Search""The Lion and the Moose - How 2 Executives Pulled off the Biggest Merger Ever""ExxonMobil Press Release""Lubricants""Archived copy"the original"Mobil 1™ and Mobil Super™ motor oil and synthetic motor oil - Mobil™ Motor Oils""Mobil Delvac""Mobil Industrial website""The State of Competition in Gasoline Marketing: The Effects of Refiner Operations at Retail""Mobil Travel Guide to become Forbes Travel Guide""Hotel Rankings: Forbes Merges with Mobil"the original"Jamieson oil industry history""Mobil news""Caltex pumps for control""Watchdog blocks Caltex bid""Exxon Mobil sells service station network""Mobil Oil New Zealand Limited is New Zealand's oldest oil company, with predecessor companies having first established a presence in the country in 1896""ExxonMobil subsidiaries have a business history in New Zealand stretching back more than 120 years. We are involved in petroleum refining and distribution and the marketing of fuels, lubricants and chemical products""Archived copy"the original"Exxon Mobil to Sell Its Japanese Arm for $3.9 Billion""Gas station merger will end Esso and Mobil's long run in Japan""Esso moves to affiliate itself with PC Optimum, no longer Aeroplan, in loyalty point switch""Mobil brand of gas stations to launch in Canada after deal for 213 Loblaws-owned locations""Mobil Nears Completion of Rebranding 200 Loblaw Gas Stations""Learn about ExxonMobil's operations in Egypt""Petrol and Diesel Service Stations in Egypt - Mobil"Official websiteExxon Mobil corporate websiteMobil Industrial official websiteeeeeeeeDA04275022275790-40000 0001 0860 5061n82045453134887257134887257

            Frič See also Navigation menuinternal link

            Identify plant with long narrow paired leaves and reddish stems Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What is this plant with long sharp leaves? Is it a weed?What is this 3ft high, stalky plant, with mid sized narrow leaves?What is this young shrub with opposite ovate, crenate leaves and reddish stems?What is this plant with large broad serrated leaves?Identify this upright branching weed with long leaves and reddish stemsPlease help me identify this bulbous plant with long, broad leaves and white flowersWhat is this small annual with narrow gray/green leaves and rust colored daisy-type flowers?What is this chilli plant?Does anyone know what type of chilli plant this is?Help identify this plant