From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Mon Jul 25 2011 - 10:23:31 CDT

On Mon, Jul 25, 2011 at 9:35 AM, Sara baretller
<sarabiocomputation_at_gmail.com> wrote:
> Hi all
>
> I am trying to understand a script and am wondering if any body knows what
> find Pdbfiles and "*.pdb"  means ???
>
> foreach f [find Pdbfiles/ -name "*.pdb"] {

this script is apparently written to work on a unix-like machine
(and more specifically one with GNU utilities installed, i.e. a Linux PC).

all commands that the tcl interpreter doesn't recognize, will be treated
as shell commands (i.e. it will use the "exec" command implicitly).

the find command will recursively look for files and the -name flag will
restrict those to the associated glob pattern, i.e. all files ending in .pdb.

the more portable unix version would be:

foreach f [ exec {find Pdbfiles/ -name "*.pdb" -print } ] {

since the find command will return a list of filenames, the for loop will
assign each of them to the variable $f and execute the loop body, which
is to load the file into VMD (using an obsolescent syntax, btw).

for more details on the find command try: man find
or: info find

this is, of course, not portable to windows.

cheers,
     axel.
> mol load pdb $f
>
>
> thank you
>
> Sara
>

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com  http://goo.gl/1wk0
Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.