home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / envedt1.zip / ENVEDIT.CMD
OS/2 REXX Batch file  |  1994-03-09  |  1KB  |  39 lines

  1.  
  2.  
  3.  
  4. /*  An OS/2 environment editor  */
  5.  
  6. /* Copyright (c) Silvio Kuczynski, 1994 All rights researved */
  7.  
  8. '@echo off'
  9.  
  10. say "An OS/2 environment editor  by Silvio Kuczynski"
  11. say " "
  12. say "Warning: This editor ONLY changes the environment for the CURRENT session !"
  13.  
  14. /* Create a file containing the environment strings */
  15. 'set > __env__'
  16.  
  17. /* Eliminates the NASTY need to define a type: */
  18. call RxFuncAdd 'sysPutEA', 'RexxUtil', 'sysPutEA' 
  19. type = "OS/2 Command File"
  20. typeinfo = "DFFF00000100FDFF'x || d2c(length(type)) || '00'x || type" 
  21. call sysPutEA "__env__", ".TYPE", "typeinfo"
  22.  
  23. /* Call the OS/2 system editor on the file */
  24. e __env__
  25.  
  26. /* Add a set command in front of every line and run it */
  27. lineread = 'temp'
  28. do forever
  29.     lineread = linein(__env__)
  30.     if lineread = '' then leave
  31.     temp1 = insert(' ''set ',lineread)
  32.     setcommand = insert(temp1,'''')
  33.     interpret setcommand
  34. end
  35.  
  36. /* Close and delete the file */
  37.  temp1 =  stream('__env__','c','close')
  38. 'del __env__'
  39.