home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / sftp127.zip / convert.cmd next >
OS/2 REXX Batch file  |  1996-03-06  |  2KB  |  72 lines

  1. /*convert program for sftp*/
  2.    rc = RxFuncAdd("SysLoadFuncs","RexxUtil","SysLoadFuncs")
  3.    rc = SysLoadFuncs()
  4. call syscls
  5. say "This utility is used to update sftp host.txt"
  6. say "files that were created with an sftp program"
  7. say "version older than version 1.11."
  8. say ""
  9. say "The host.txt file in version 1.11 takes a new"
  10. say "format that supports host aliases. Old host.txt"
  11. say "files will not work with version 1.11 and must"
  12. say "be converted."
  13. say ""
  14. say "This utility will display your host names with"
  15. say "their statistics one at a time. You then have"
  16. say "the opportunity to add an alias for each of the"
  17. say "hosts. You may want to work with a copy of your host.txt"
  18. say "if you have spent a good deal of time building it."
  19. say "This program expects to find a copy of host.txt in"
  20. say "the directory that it resides."
  21. say ""
  22. say "Do you want to continue with this program?"
  23. say ""
  24. say "Press Y and ENTER to continue."
  25.  
  26. pull test
  27. if test = "Y" then
  28. do
  29. filename="hosts.txt"
  30. i=0
  31. do
  32. do while lines(filename)
  33. i=i+1
  34. hostval.i.hst=linein(filename)
  35. hostval.i.usr=linein(filename)
  36. hostval.i.pas=linein(filename)
  37. hostval.i.dir=linein(filename)
  38. end /* end do */
  39. hostcount=i
  40. rc=stream(filename,'c','close')
  41. end /* end do */
  42.  
  43. filename='hosts.txt'
  44. rc=sysfiledelete(filename)
  45. rc=lineout(filename)
  46. do i = 1 to hostcount
  47. call syscls
  48. say hostval.i.hst
  49. say hostval.i.usr
  50. say hostval.i.pas
  51. say hostval.i.dir
  52. say ""
  53. say "The host statistics for host number "||i
  54. say "are listed above."
  55. say ""
  56. say "Please type an alias name for this host."
  57. say "For example, a host such as hobbes.nmsu.edu"
  58. say "with the default directory set to /incoming"
  59. say "could use an alias such as "hobbes incoming.""
  60. say ""
  61. say "Enter the alias below and press enter when done."
  62. parse pull alias
  63. hostval.i.als=alias
  64. rc=lineout(filename,hostval.i.als)
  65. rc=lineout(filename,hostval.i.hst)
  66. rc=lineout(filename,hostval.i.usr)
  67. rc=lineout(filename,hostval.i.pas)
  68. rc=lineout(filename,hostval.i.dir)
  69. end
  70. rc=lineout(filename)
  71. end
  72.