Hmmmm. So has the fact that you don't have crontab on your box a total irrelevance or is there something that you know but are failing to tell us?
The script as written doesn't work. function showMenu () instead of showMenu () in line 1 will fix that though.
So what you are actually saying is, if you execute the following at the command line, it
[code]ssh -l root "localhost" "top -nl;"[code]is returning with "TERM environment variable is not set"?
This is a minimal test case and if this fails then it's an indication that the script is in not really part of the problem. You can of course substitute your favourite IP address for localhost if you wish.
What does
Code:
env | grep TERM > result.txt
return in result.txt? Well if it isn't redirected into the file you shoud probably see something like TERM=xterm. If you put it in a shellfile and execute it as ./shellfile you will get much the same. BUT if you execute it with at -f shellfile xx:xx then it will not find TERM in the env list. Because there is no terminal associated with the batch. The same goes for CRON and when you arrive at your destination with ssh do you have a terminal available? perhaps asking ssh for the env |grep TERM will give some clues.
So is it likely that your top command executing on the remote platform probably also has no terminal, but is TERM expected by top and being disapointed?
I may well be wrong, but I think these are a few things to think about in your search.
Good luck PAix
PS - Your code, corrected by the addition of function as mentioned above and given "localhost" as the IP; I got the following, but then I don't know much about my ssh setup.
ssh -l root Localhost "top -nl;"
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is af:14:f8:ab:46:b1:c5:db:f1:14:22:54:71:ff:c4:6c.
Are you sure you want to continue connecting (yes/no)?
no
Host key verification failed.
Actually I think you got this answer to your post here:
http://www.linuxquestions.org/questi...ng-ssh-593398/