the problem is that when i drag the text file to the terminal window the script stops after the
script -akq Desktop/TerminalLogin/Cisco1Bob.txt
line and does not send the telnet to the screen,
You typically start a shell script with a shebang, either #!/bin/bash or #!/bin/sh.
Next when you save the script, save it with the .command extension, which will make it executable from the GUI so you can just double click your script and not have to run it from terminal.
Are you trying to read something from that text file?
the script command logs all screen output (from the terminal) to a file, so i may review later on.
is there a different command that may do this?
this is what i got for the script (.common file):
telnet 6.20.9.35
Admin
xxxx
this is what i get when i run it in the terminal:
rastas-macbook:~ Rasta$ /Users/Rasta/Desktop/login1.common ; exit;
Trying 6.20.9.35...
Connected to cust-6.20.9.35.switchn.com.
Escape character is '^]'.
User Access Verification
Username:
Username:
Username:
Connection closed by foreign host.
/Users/Rasta/Desktop/login1.common: line 2: Admin: command not found
/Users/Rasta/Desktop/login1.common: line 3: Admin1LV082008: command not found
logout
It looks like its not authenticating. but it is hard to tell with out seeing the whole script. Can you copy/paste the whole script? You can leave out any personal information about the systems, I just want to see what commands with what switches are running.
AFAIK MacOS X uses tcsh as it's default shell (or do you use something else?). If so, I have two suggestions:
Use another shell. csh/tcsh are bad in terms of usability for more than executing simple commands
Try changing your script as follows text telnet 6.20.9.35 <<EOF Admin Password EOF
I can't guarantee that that will work, as most implementations of telnet will only accept input from the terminal (keyboard that is). If the code above does not work, you should look into enabling access via SSH and a keypair. If that's not possible, try expect or netcat.