Script to run non-stop

Thanks porter.

Now i understand.
Your dummy script is actually a non-stop loop.
Once kill is executed, process is killed but it will need to wait for the current "sleep" command to finish performing.
Hope my understanding is correct. Let me know if i am wrong

hi porter,

I did a " nohup mycshscript & " command but when i do a " job -l " , it is showing that the process has stopped. Why? What does tty output mean ?

$ jobs -l
[3]  + 28124 Stopped (tty output) mycshscript
$

You'll need to look up job control for your shell....

eg Job Control

Hi all,

What does 'shell without control' means? I ssh to a server and then, run a process like this:

nohup binproc > proc.log 2> proc.err &

But, when I closed the sesion, the process died.

Should it be different if I telnet the server instead of ssh?

Regards,

Erwin

Hi Porter,

If there's some mismatch in the input file which causes the script to output an error -> " Unrecognized command: ,$ p ". Will this be appended to the file "nohup.out" as well ?

If you don't do any other redirection, nohup.out will have both stdout and stderr.

Hi Porter,

Thanks. Can you show me some codes that would re-direct this unexpected error output ?
I am using csh by the way

I steer clear of csh like the plague, I'm sorry.

Hi ,

I don;t quite understand this link. Too deep for beginners like me.
Can somebody explain why or give me some guidance on why this will happen when i apply " nohup mycshscript & " ?
Appeciate your help.

$ jobs -l
[3]  + 28124 Stopped (tty output) mycshscript
$

which shell ?

Hi ,

I am using csh.
I tried using the below command as well.
What does this statement " sending output to nohup.out" means ? Does it mean my script can run with me exiting the command prompt window already ?
However, when i type " jobs -l ", no jobs seems to be running . Can some experts help ?

$ /bin/nohup mycshscript &
[7] 19804
$ Sending output to nohup.out
$ jobs -l 
$

Background process attempts I/O, hence the reason.

Better make your process read input from a file rather than a terminal

that should solve the problem

Hi matrixmadhan,

Don't really understand how you define reading input from a file rather than a terminal. Can you give me some process examples where process is reading from a file and process is reading from a terminal ?

how to read input from a file ?

cat t
example

read var < t
echo $var
example

reading input from a terminal

read var

reading input from a terminal as a background process

read var &

Hi matrixmadhan,

Can you enlightened me on the above?

the output from the script is redirected to the file nohup.out whether its stderr or stdout

once

 nohup script &

is in place
the current session from which the script is invoked can be terminated.

the script / process would still continue run as a background process

$ jobs -l 
$

Is the command jobs -l executed on a different session i.e. the session from which the script is not executed ?

jobs is an entity that is binded to each terminal session, i.e. each session will have its own list of jobs and they are not universal across sessions like process

Hi ,

My csh script actually contains a ftp code.
Will this cause this " [3] + 28124 Stopped (tty output) mycshscript " ??

set USER = "aaa"
set PASS = "bbb"
ftp -n 10.10.10.10<< EOL >  /dev/null
user $USER $PASS
cd /myfolder
lcd $TEMP
prompt
ascii
mget $xxx[$num]
EOL