I wrote a script that will be run in background and echo some status information from time to time.
after the loop and output I want to get back to prompt automatically.
currently I have to press return to see prompt again. is this possible to do?
no, the loop should go on - but -
after calling 'echo' the prompt in shell I'm working in is gone.
if I type 'return' prompt is back. possible to send this keycode from inside of the script?
cko 1 & to run in background with endless loop (without 1st parameter to run just 1 time)
oh, sorry - didn't put the whole script in here. logvariables are defined - filenames
script creates "image" of something and stores it in $log on 1st run.
inside of the loop new image is created to $logfile and "compared" to previously created one.
changes should immediately printed out with 'echo' (maybe security issues).
To answer the question in post #1.
It is not possible for a background task to type input on the foreground keyboard.
It is not normal to create a background process which outputs to a terminal - it will clash with any foreground process.
hmm... the script should look for running foreground processes on same terminal to prevent this?
there's just one problem left - guess we can not check if some chars already entered into prompt?
maybe you are right - background processes should not output something to stdout/terminal.
I just thought about emergency situation of processes in the back..
how to inform the terminal user?