I want to start a script remotely via ssh like this:
ssh [email protected] -t 'cd my/dir && ./myscript data [email protected]'
The script does various things which work fine until it comes to a line with nohup:
nohup time ./myprog $1 >my.log && mutt -a ${1%.*}/`basename $1` -a ${1%.*}/`basename ${1%.*}`.plt $2 < my.log 2>&1 &
it is supposed to do start the program myprog, pipe its output to mylog and send an email with some datafiles created by myprog as attachment and the log as body. Though when the script reaches this line, ssh outputs:
Connection to remote.org closed.
What is the problem here?
Thanks for any help
./myprog
write to stdout if its arguments were incorrect? What doesmyerr.log
contain when you write./myprog $1 >my.log 2>myerr.log
? – Upbraiding