home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1994 February / psl_9403.zip / psl_9403 / DOS / COMMUNIC / HA221B.ZIP / SAMPAPP.SCR < prev    next >
Text File  |  1993-07-27  |  1KB  |  75 lines

  1. REM SAMPAPP.SCR
  2. REM 07/27/93
  3. REM Sample script to log-on to Unix and start an application
  4. REM (WordPerfect is used as an example)
  5. REM
  6. DIM appcmd 64 product 32
  7. REM
  8. REM logname:  the login name of the user
  9. REM password: the login password of the user
  10. REM appcmd:   the Unix command string to start the application
  11. REM product:  the name of the application to display on the screen
  12. REM
  13. LET logname = username
  14. LET password = userpass
  15. LET appcmd = wp
  16. LET product = WordPerfect
  17. REM
  18. REM First, tell the user what we're going to do
  19. REM
  20. SCREEN ON
  21. CLS
  22. ECHO Logging on to the Unix system...
  23. SCREEN OFF
  24. REM
  25. REM See if Unix is there -- look for login:
  26. REM
  27. TIMEOUT 2
  28. SEND {CR}
  29. EXPECT ogin:
  30. IF {err} = 0 GOTO LOGIN
  31. REM
  32. REM Send a Ctrl-D in case we're already logged in
  33. REM
  34. :AGAIN
  35. SEND {04}
  36. EXPECT ogin:
  37. IF {err} <> 0 GOTO NOUNIX
  38. :LOGIN
  39. REM
  40. REM Now attempt to log in -- send user name
  41. REM
  42. WAIT 1
  43. SEND {logname}{CR}
  44. REM
  45. REM Now send password (give Unix 4 seconds to respond)
  46. REM
  47. TIMEOUT 4
  48. EXPECT word:
  49. IF {err} <> 0 GOTO AGAIN
  50. SEND {password}{CR}
  51. EXPECT $
  52. IF {err} <> 0 GOTO NOUNIX
  53. REM
  54. REM Now start up application
  55. REM
  56. SCREEN ON
  57. CLS
  58. ECHO Starting {product}...
  59. SCREEN OFF
  60. WAIT 2
  61. TIMEOUT 1
  62. SEND {appcmd}{CR}
  63. EXPECT {LF}
  64. SCREEN ON
  65. CLS
  66. STOP
  67. :NOUNIX
  68. SCREEN ON
  69. CLS
  70. ECHO Cannot log on to Unix.
  71. ECHO Contact the system administrator.
  72. ECHO
  73. STOP
  74.  
  75.