%%s 3/3/94 %%d D 1.2 30-Jul-83 08:33:30 tools 2 1 %%c Removed trailing periods from quoted strings. %%s 0/0/0 %%d D 1.1 27-Mar-82 14:58:36 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 %%D 2 #-h- cp.r 1128 asc 25-mar-82 09:31:10 v1.1 (sw-tools v1.1) #-h- main 1055 asc 25-mar-82 09:31:01 v1.1 (sw-tools v1.1) %%E 2 %%I 2 #-h- cp.r 1132 asc 30-jul-83 08:33:01 tools (lblh csam sventek) #-h- main 1054 asc 30-jul-83 08:31:22 tools (lblh csam sventek) %%E 2 ### Cp Copy files. DRIVER(cp) character cmd(MAXLINE), pid(PIDSIZE) character file1(FILENAMESIZE), path1(FILENAMESIZE) character file2(FILENAMESIZE), path2(FILENAMESIZE) integer i, verbos integer getarg, index, length, spawn # function(s) string aster "*" string copstr "copy " string locstr "local" string logstr " /log" string usestr "? Usage: cp [-v] from [to]" data verbos / NO / call query(usestr) if( getarg( 1, path1, FILENAMESIZE) != EOF ) { if( path1(1) == '-' ) { if( path1(2) == 'v' | path1(2) == 'V' ) verbos = YES call delarg(1) } } if( getarg( 1, path1, FILENAMESIZE) == EOF ) call error(usestr) if( getarg( 2, path2, FILENAMESIZE) == EOF ) call strcpy( aster, path2) call mklocl( path1, file1) call mklocl( path2, file2) i = 1 call stcopy( copstr, 1, cmd, i) call stcopy( file1, 1, cmd, i) call chcopy( ' ', cmd, i) call stcopy( file2, 1, cmd, i) if( verbos == YES ) call stcopy( logstr, 1, cmd, i) if( spawn( locstr, cmd, pid, WAIT) == ERR ) %%D 2 call error("? Can't spawn ``copy''.") %%E 2 %%I 2 call error("? Can't spawn ``copy''") %%E 2 DRETURN end #-h- cp.fmt 1025 asc 25-mar-82 09:31:10 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Cp (1) 14-Nov-81 copy files .sy cp [-v] from [to] .ds Cp duplicates file ``from'' into file ``to''. If the ``to'' argument is omitted, ``*'' is assumed. If the ``-v'' (verbose) option is specified, a confirming message is displayed as each file is copied. .ex .ti +8 cp file.c file.bak .sp .fi would make a backup copy of ``file.c'' called ``file.bak''. .sp .ti +8 cp ~usrlib/command.fmt .sp would make a copy of ``~usrlib/command.fmt'' in the current directory keeping the same name. .sp .ti +8 cp -v ~src/*.w /mt/* .sp would make a backup copy of all files with an extension of ``.w'' in directory ``~src'' onto magnetic tape, confirming each file copied. .fl none .im Cp spawns the DCL ``copy'' command after converting the two arguments from pathnames to filespecs. If the ``-v'' option is specified, the DCL ``/log'' qualifier is added. .sa mv -- move files .br The UNIX command ``cp''. .di ? Can't spawn ``copy''. .au Dave Martin (Hughes Aircraft) .bu DCL wildcards work; regular expressions don't. %%E 1