#!/bin/sh # The next line restarts using nmrWish \ exec nmrWish "$0" -notk -- "$@" # # Adjusted 4/23/99 by Gabriel and Frank. # We should have demolished it instead. set auto_path "[split $env(TCLPATH) :] $auto_path" set tcl_precision 12 set usage "usage: $argv0 \[-curdat\]\n\ \nwill will create add_files subdirectory\n\ -curdat: switch to current data set" set args "$argv0 $argv" if {[lsearch $args -help] != -1} { puts stderr $usage exit 0 } if {[lsearch $args -curdat] != -1} { catch {exec curd -a} curdat catch {cd $curdat} msg puts stderr $msg } catch {exec pwd} curdat puts stderr "putting add_files into $curdat" rdJCAMP acqus BRUK set SDIR /u/exp/stan/nmr/lists set DDIR add_files set dir_list { cpd wave f1 pp gp vc vd vp vt } set files_dir { PULPROG pp {} CPDPRG cpd {} CPDPRG1 cpd {} CPDPRG2 cpd {} CPDPRG3 cpd {} CPDPRG4 cpd {} CPDPRG5 cpd {} CPDPRG6 cpd {} CPDPRG7 cpd {} CPDPRG8 cpd {} CPDPRGB cpd {} CPDPRGT cpd {} DBPNAM0 wave {} DBPNAM1 wave {} DBPNAM2 wave {} DBPNAM3 wave {} DBPNAM4 wave {} DBPNAM5 wave {} DBPNAM6 wave {} DBPNAM7 wave {} DPNAME0 wave {} DPNAME1 wave {} DPNAME2 wave {} DPNAME3 wave {} DPNAME4 wave {} DPNAME5 wave {} DPNAME6 wave {} DPNAME7 wave {} SPNAM0 wave {} SPNAM1 wave {} SPNAM2 wave {} SPNAM3 wave {} SPNAM4 wave {} SPNAM5 wave {} SPNAM6 wave {} SPNAM7 wave {} SPNAM8 wave {} SPNAM9 wave {} SPNAM10 wave {} SPNAM11 wave {} SPNAM12 wave {} SPNAM13 wave {} SPNAM14 wave {} SPNAM15 wave {} GPNAM0 gp {} GPNAM1 gp {} GPNAM2 gp {} GPNAM3 gp {} GPNAM4 gp {} GPNAM5 gp {} GPNAM6 gp {} GPNAM7 gp {} GPNAM8 gp {} GPNAM9 gp {} GPNAM10 gp {} GPNAM11 gp {} GPNAM12 gp {} GPNAM13 gp {} GPNAM14 gp {} GPNAM15 gp {} GPNAM16 gp {} GPNAM17 gp {} GPNAM18 gp {} GPNAM19 gp {} GPNAM20 gp {} GPNAM21 gp {} GPNAM22 gp {} GPNAM23 gp {} GPNAM24 gp {} GPNAM25 gp {} GPNAM26 gp {} GPNAM27 gp {} GPNAM28 gp {} GPNAM29 gp {} GPNAM30 gp {} GPNAM31 gp {} GRDPROG gp .r FQ1LIST f1 {} FQ2LIST f1 {} FQ3LIST f1 {} FQ4LIST f1 {} FQ5LIST f1 {} FQ6LIST f1 {} FQ7LIST f1 {} FQ8LIST f1 {} VCLIST vc {} VDLIST vd {} VPLIST vp {} VTLIST vt {} } set l [llength $files_dir] for {set i 0} {$i < $l} {} { set file [lindex $files_dir $i] incr i set dir [lindex $files_dir $i] set DIR($file) $dir incr i set ext [lindex $files_dir $i] set EXT($file) [string trim $ext] incr i } set out [open a_f.com w+ 0744] puts $out "#!/bin/csh" puts $out "" foreach dir $dir_list\ { puts $out "if (!(-e ${DDIR}/$dir)) then" puts $out " mkdir -p ${DDIR}/$dir" puts $out "endif" } foreach file [array names DIR]\ { if {![info exists BRUK($file)]} continue set BRUK($file) [string trim $BRUK($file)] if {![llength $BRUK($file)]} continue puts $out "if (-e ${SDIR}/$DIR($file)/$BRUK($file)$EXT($file)) then" puts $out " /bin/cp ${SDIR}/$DIR($file)/$BRUK($file)$EXT($file) \\" puts $out " ${DDIR}/$DIR($file)/$BRUK($file)$EXT($file)" puts $out "endif" } close $out catch {exec csh a_f.com} msg puts stderr $msg catch {exec /bin/rm a_f.com} msg puts stderr $msg exit 0