On Sun, Jan 05, 2003 at 01:19:59AM -0600, Gerald V. Livingston II wrote: > The script:cat ~/bin/names > > #!/bin/bash > > typeset -i a=1 > > if [ `ls /t/*.jpg 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.jpg; > do mmv "$i" /t/`date +%s`-$a.jpg; a=a+1; done > if [ `ls /t/*.JPG 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.JPG; > do mmv "$i" /t/`date +%s`-$a.jpg; a=a+1; done > fi > fi
how about ls /t/*.jpg /t/*.JPG /t/*.jpeg 2>/dev/null | wc -l or ls /t/*.{jpg,jpeg,JPG,JPEG} 2>/dev/null | wc -l hmm? only one test, all done. > if [ `ls /t/*.gif 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.gif; > do mmv "$i" /t/`date +%s`-$a.gif; a=a+1; done > if [ `ls /t/*.GIF 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.GIF; > do mmv "$i" /t/`date +%s`-$a.gif; a=a+1; done > fi > fi same here: ls /t/*.gif /t/*.GIF /t/*.GIFF 2>/dev/null | wc -l or even ls /t/*.{gif,GIF,giff,GIFF} 2>/dev/null | wc -l > if [ `ls /t/*.bmp 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.bmp; > do mmv "$i" /t/`date +%s`-$a.bmp; a=a+1; done > if [ `ls /t/*.BMP 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.BMP; > do mmv "$i" /t/`date +%s`-$a.bmp; a=a+1; done > fi > fi ls /t/*.{bmp,BMP} 2>/dev/null | wc -l > if [ `ls /t/*.bmp 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.bmp; > do convert "$i" `basename "$i" .bmp`.jpg; rm -f "$i"; done > fi nicely done. > if [ `ls /t/*.jpg 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.jpg; > do echo "http://host.com/images/$i" >>/t/links; done > fi > > if [ `ls /t/*.gif 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.gif; > do echo "http://host.com/images/$i" >>/t/links; done > fi how about for i in /t/*.{gif,jpg}; do echo "http://host.com/images/$i" >> /t/links ; done get all the gif and jpg in one swoop. -- I use Debian/GNU Linux version 3.0; Linux server 2.2.17 #1 Sun Jun 25 09:24:41 EST 2000 i586 unknown DEBIAN NEWBIE TIP #12 from Will Trillich <[EMAIL PROTECTED]> : Where is the DOCUMENTATION? It's all over the place... and there's lots of it. Much was written for non-debian distributions, and much was written long, long ago. But try these anyhow: on your own system, try "man" and "info" and "apropos", and also look under /usr/share/doc/<package>* ... Online, there's linuxdoc.org, debianhelp.org, and debian.org/doc/ of course. Also try http://newbiedoc.sourceforge.net/general/index-deb-help-sys.html and apt-get install dhelp Also see http://newbieDoc.sourceForge.net/ ... -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]