Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move files

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
Hi!

I have the following awk script
Code:
delfiles = "\\.inp|\\.tmpcgm|\\.lst|\\.log|\\.w1|\\.hzbf|\\.w2|\\.w3|\\.core|\\.tmp|\\zap3workfile|\\tmpcgm|\\hzbf\\."

#file extensions not to copy for ASI
asifiles = "\\.tod|\\.tod_glb|\\.sgy|\\.segy|\\.gbs|\\.ash|\\.gsr|\\.psh|\\.shf|\\.psp|\\.tsp|\\.asp|\\.sess|\\.hts|\\.hzd|\\.2cl|\\.cdf|\\.cdf|\\.zgf|\\.asc|\\.ZGF|\\.dts|\\.mcf|\\.zcm|\\.ptf|\\.mfd|\\.cgm|\\.hzh_glb|\\.hzd_glb|\\.fmt|\\.msc"

#file extensions not to copy for PN and VDG
pnfiles = "\\.3dv|\\.3dh|\\.bri|\\.bri.meta|\\.cmp|\\.cmp.meta|\\.2v2_glb|\\.2v2.scaleFactor_glb|\\.lh_glb|\\.st_glb|\\.xy_glb" 
if (asi == 1)
   { 
	nocopy  = "'"asifiles"|"delfiles"'"
        
   } else {
	nocopy  = "'"pnfiles"|"delfiles"'"
        }

# copy other data disks
		for (iii=1;iii<ndir;iii++) {
			dummy=dest_dir"/"SW_proj3D[ii]
	                if ( system("test -d " dummy) != 0 ) {
                		system("/usr/bin/mkdir " dummy)
			}
			dummy2=orig_dir[iii]"/"SW_proj3D[ii]
		        system("cd " dummy2 " ; find . -print | egrep -v " nocopy " | cpio -pdvmu " dummy " >> " logfile)
				
                }

1) what would be the best way to do this in Tcl?
There is no option egrep in file copy that I can see.
2) Is there a way to move and "filter" files instead of copying them?

Many thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top