The Molecular Graphics Laboratory Forum
http://mgl.scripps.edu/forum/

ex01.csh script running problem
http://mgl.scripps.edu/forum/viewtopic.php?f=27&t=3257
Page 1 of 1

Author:  Ash100 [ Thu Jul 07, 2016 7:12 am ]
Post subject:  ex01.csh script running problem

Hello,
Sorry in advance if my questions are very basics. I trying to repeat PDF tutorial files for my small ZINC library and receptor.
# use the UNIX utility csplit to divide the multi-molecule mol2
# file into separate files

cat $VSTROOT/zinc.mol2|csplit –ftmp –n –ks –
‘%^@.TRIPSO.MOLECULE%’ ‘/^@.TRIPOS.MOLECULE/’ ‘{* }’

Using the above script I have successfully generated the tmp files.
#Rename the tmp file according to ZINC identifier
# Here is the outline of how we do this:
# 1. Extract ZINCn8 from the tmpNNNN file and set to variable
# 2. If the Zn8.mol2 file does not exit, rename tmpNNNN files

foreach f (tmp*)
echo $f
set zid = `grep ZINC $f`
if !(-e “$zid”.mol2) then
set filename = “$zid”.mol2
else foreach n (`seq –w 1 99`)
if !(-e “$zid”_”$n”.mol2) then
set filename = “$zid”_”$n”.mol2
break
endif
end
endif
mv –v $f $filename
end

Now when ever I try the foreach f (tmp*) step, every time I received an error of bash :syntax near unexpected token error '('. Please guide me how I can successfully finish this step or where I am making a mistake?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/