Skip to main content
added 186 characters in body
Source Link
mikeserv
  • 59.4k
  • 10
  • 122
  • 242

instead of running login immediately at tty initialization, run a script like the following instead:

#!/bin/sh
(   trap '' TTOU
    while   clear
    do      #gen your output
            sleep 2
    done
) & stty -icanon
    dd    count=1 >/dev/null 2>&1
    stty  icanon
    exec  login

...that will run whatever you put in your loop until at least a single byte is read from the tty, at which time login will be called up. login always starts off with a HUP on its controlling tty, and so the backgrounded process writing your output to the terminal will die as soon as it does, but until someone presses a key it will continue to cycle over producing whatever output you wish. Even if it can write output to its controlling tty from the background, no matter what your backgrounded loop tries to do, though, it will never succeed in reading any input from it.

instead of running login immediately at tty initialization, run a script like the following instead:

#!/bin/sh
(   trap '' TTOU
    while   clear
    do      #gen your output
            sleep 2
    done
) & stty -icanon
    dd    count=1 >/dev/null 2>&1
    stty  icanon
    exec  login

...that will run whatever you put in your loop until at least a single byte is read from the tty, at which time login will be called up. login always starts off with a HUP on its controlling tty, and so the backgrounded process writing your output to the terminal will die as soon as it does, but until someone presses a key it will continue to cycle over producing whatever output you wish.

instead of running login immediately at tty initialization, run a script like the following instead:

#!/bin/sh
(   trap '' TTOU
    while   clear
    do      #gen your output
            sleep 2
    done
) & stty -icanon
    dd    count=1 >/dev/null 2>&1
    stty  icanon
    exec  login

...that will run whatever you put in your loop until at least a single byte is read from the tty, at which time login will be called up. login always starts off with a HUP on its controlling tty, and so the backgrounded process writing your output to the terminal will die as soon as it does, but until someone presses a key it will continue to cycle over producing whatever output you wish. Even if it can write output to its controlling tty from the background, no matter what your backgrounded loop tries to do, though, it will never succeed in reading any input from it.

Source Link
mikeserv
  • 59.4k
  • 10
  • 122
  • 242

instead of running login immediately at tty initialization, run a script like the following instead:

#!/bin/sh
(   trap '' TTOU
    while   clear
    do      #gen your output
            sleep 2
    done
) & stty -icanon
    dd    count=1 >/dev/null 2>&1
    stty  icanon
    exec  login

...that will run whatever you put in your loop until at least a single byte is read from the tty, at which time login will be called up. login always starts off with a HUP on its controlling tty, and so the backgrounded process writing your output to the terminal will die as soon as it does, but until someone presses a key it will continue to cycle over producing whatever output you wish.