B"H
On 7/11/05, Todd Walton <[EMAIL PROTECTED]> wrote:
> On 7/11/05, Menachem Shapiro <[EMAIL PROTECTED]> wrote:
> > #!/bin/bash
> >
> > for i in `ls *.doc`
> > do
> > #use cut to split $i into 2 fields, one before the dot and one
> > after.
> > #take the first part (all except the extension) and use it as
> > a base for the txt file
> > BASE=`echo $i |cut -f1 -d.`
> > wvText $i ${BASE}.txt
> > done
>
> 'echo resume.ToddWalton.doc |cut -f1 -d.'
>
> "resume"
Well then, what about this:
for i in `ls *.doc`
do
BASE=`echo $i |sed s/\.doc$//`
mv $i ${BASE}.txt
done
sed s/\.doc$// - should get rid of only the last .doc and then the
next line replaces it with .txt (this should work even if the file is
named resume.doc.july.doc).
Menachem
>
> -todd
>
>
> --
> [email protected]
> http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
>
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list