VMD-L Mailing List
From: Pavan Ghatty (pavan.vmd_at_gmail.com)
Date: Tue Jul 26 2011 - 11:14:15 CDT
- Next message: Sara baretller: "Re: Understand a script"
- Previous message: John Stone: "Re: Question about eval"
- In reply to: Axel Kohlmeyer: "Re: Question about eval"
- Next in thread: John Stone: "Re: Question about eval"
- Reply: John Stone: "Re: Question about eval"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hello Axel,
My problem is solved. But I was wondering if there was a more elegant way of
doing things when there is only one pdb file in the workdir. As I mentioned
in my initial question, there is only one pdb file; protein.pdb or
edit_protein.pdb. So
>eval ls [glob *.pdb]
results in only one file being identified, not two. I understand that "mol
new" takes only one file/argument per invocation. But that cannot be the
reason why
>mol new [eval ls [glob *.pdb]]
fails in this case. I am just probing this issue to see if there is
something new to be learned here.
Thanks
On Mon, Jul 25, 2011 at 3:33 PM, Axel Kohlmeyer <akohlmey_at_gmail.com> wrote:
> On Mon, Jul 25, 2011 at 2:51 PM, Pavan Ghatty <pavan.vmd_at_gmail.com> wrote:
> > Hello All,
> > I have one of the following two files in my workdir. protein.pdb or
> > edit_protein.pdb
> > I would like to do the following:
> > 1. ls *.pdb
> > 2. mol new [ls*.pdb]
>
> this _cannot_ work since mol new only takes a single file as an argument.
>
> > This clearly doesn't work.
> > I tried to see if I could at least select the file using; ls *.pdb.
> > ---------------
> > vmd > ls *.pdb
> > /bin/ls: cannot access *.pdb: No such file or directory
> > child process exited abnormally
> > ---------------
>
> yes. this has to be, since the ls command actually doesn't
> do the expansion of the * wildcard, but the shell itself does it
> when to you type "ls *.pdb" (this is called globbing and can
> be disabled even).
>
> > I then found out that this works;
> > eval ls [glob *.pdb]
> > But then the following does not work;
> > mol new [eval ls [glob *.pdb]]
> > nor does this
> > mol load pdb [eval ls [glob *.pdb]]
> > They both die with this error;
> > Warning) Unable to ascertain filetype from filename ''; assuming pdb.
> > Can somebody help me out here?
>
> yes, because you have the principle error that mol new only accepts
> one file name
> per invocation. what you have to do is to build a loop (an example for that
> was
> given on the list earlier using some quirky find shell command).
>
> so if you do:
>
> foreach f [glob *.pdb] {
> mol new $f waitfor all
> }
>
> you should get what you desire.
>
> axel.
>
> > Thanks.
>
>
>
> --
> Dr. Axel Kohlmeyer
> akohlmey_at_gmail.com http://goo.gl/1wk0
>
> Institute for Computational Molecular Science
> Temple University, Philadelphia PA, USA.
>
- Next message: Sara baretller: "Re: Understand a script"
- Previous message: John Stone: "Re: Question about eval"
- In reply to: Axel Kohlmeyer: "Re: Question about eval"
- Next in thread: John Stone: "Re: Question about eval"
- Reply: John Stone: "Re: Question about eval"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]