You can also break it down like this (assuming the files have numeric
names):
for d in 0 1 2 3 4 5 6 7 8 9; do
for f in $d*; do
...
done
done
Craig
On Sat, Jun 27, 2015 at 11:16 AM, Matthew Baumgartner <mp...@pitt.edu>
wrote:
> Actually it does work, I tested it (on ubuntu 14.04).
>
> #make a ton of empty files
> for i in {1..1000000} ; do touch tmpfilename_${i}.txt ; done
>
> ls *.txt
> >Argument list too long.
>
> #this works
> for f in *.txt ; do echo $f ; done
>
>
> On 6/27/2015 6:01 AM, Dmitri Maziuk wrote:
> > On 6/26/2015 11:26 AM, Matthew Baumgartner wrote:
> >> That is a limitation of linux there is a maximum length of the command
> >> line. You should be able to use a for loop in bash like:
> >>
> >> for f in *.pdb ; do babel ${f} -omol2 ${f%.*}.mol2 ; done
> >>
> >> The ${s%.*} bit is some bash string manipulation for stripping the file
> >> extension.
> > Not gonna work because the error is from the shell expanding '*.pdb' to
> > a "too long" list. Shell expansion is still there in the above.
> >
> > If you move all your pdb files in one directory, just "for f in `ls` ;
> > do obabel ..." will do. Otherwise there's a million ways to check the
> > extension, but they all require jumping through extra hoops.
> >
> > Dima
> >
> >
> >
> ------------------------------------------------------------------------------
> > Monitor 25 network devices or servers for free with OpManager!
> > OpManager is web-based network management software that monitors
> > network devices and physical & virtual servers, alerts via email & sms
> > for fault. Monitor 25 devices for free with no restriction. Download now
> > http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
> > _______________________________________________
> > OpenBabel-discuss mailing list
> > OpenBabel-discuss@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
>
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors
> network devices and physical & virtual servers, alerts via email & sms
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
--
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
---------------------------------
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss