Task

Rename:

   a file called     input.txt     into     output.txt     and 
   a directory called     docs     into     mydocs.


This should be done twice:  
once "here", i.e. in the current working directory and once in the filesystem root.

It can be assumed that the user has the rights to do so.

(In unix-type systems, only the user root would have
sufficient permissions in the filesystem root.)




/*REXX program renames a file & a directory  (in current dir & in root).*/
trace off                              /*suppress error messages, bad RC*/
 
    do 2                               /* [↓]  perform this code twice. */
    'RENAME' "input.txt  output.txt"   /*rename a particular DOS file.  */
    'MOVE'   "\docs  \mydocs"          /*use (DOS) MOVE to rename a dir.*/
    'CD'     "\"                       /*for 2nd pass, change──►root dir*/
    end   /*2*/
                                       /*stick a fork in it, we're done.*/