apoc.feuer
June 14th, 2005, 04:08 AM
I'm not sure whether I'm posting it at the correct section or not though, moderators kindly shift this thread to a appropiate section if this thread is ir-relevant here. Ok, the story is this, I have a Ubuntu machine that requires gain access to my Unix server. Right now I'm using telnet to gain access to it. But the process might be complicated to my end users the steps are as follows:
From terminal:
Step 1:telnet
Step 2:telnet>environ define TERM 'VT100' <---Because my Unix can only recongnise terminals that are set to VT100
Step 3:telnet>environ define TERMCOLOR 'VT100'
Step 4:telnet>open 192.XXX.X.XXX
Step 5: End user log in with their userid and password to gain access to our server
In order for me to minimise typo-error for end-users etc, I have created a shell script so that the above process is automated and end users only need to log in our Unix server to perform their daily tasks. This is where I got stuck...below is my shell script (Guess i simplify the entire script too much??!! I'm clueless here...)
My first shell script (test.sh)
==================
Line 1: telnet
Line 2: environ define TERM 'VT100'
Line 3: environ define TERMCOLOR 'VT100'
Line 4: open 192.XXX.X.XXX
==================
Error message
==========
./test.sh: line 2: environ: command not found
./test.sh: line 3: environ: command not found
==========
It's seems that my script is unable to carry out the correct command in telnet environment. Is it possible to let my script 'know' that it's in the telnet environment and it must set the terminal type to VT100 in order for it to gain access to our unix server? Any advise/suggestions would be greatly appreciated. (Anyway this is my first time doing shell script hehe)
From terminal:
Step 1:telnet
Step 2:telnet>environ define TERM 'VT100' <---Because my Unix can only recongnise terminals that are set to VT100
Step 3:telnet>environ define TERMCOLOR 'VT100'
Step 4:telnet>open 192.XXX.X.XXX
Step 5: End user log in with their userid and password to gain access to our server
In order for me to minimise typo-error for end-users etc, I have created a shell script so that the above process is automated and end users only need to log in our Unix server to perform their daily tasks. This is where I got stuck...below is my shell script (Guess i simplify the entire script too much??!! I'm clueless here...)
My first shell script (test.sh)
==================
Line 1: telnet
Line 2: environ define TERM 'VT100'
Line 3: environ define TERMCOLOR 'VT100'
Line 4: open 192.XXX.X.XXX
==================
Error message
==========
./test.sh: line 2: environ: command not found
./test.sh: line 3: environ: command not found
==========
It's seems that my script is unable to carry out the correct command in telnet environment. Is it possible to let my script 'know' that it's in the telnet environment and it must set the terminal type to VT100 in order for it to gain access to our unix server? Any advise/suggestions would be greatly appreciated. (Anyway this is my first time doing shell script hehe)