[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Problems w/ mv and sed
- Subject: [ale] Problems w/ mv and sed
- From: j.bunster at earthlink.net (Jordi S. Bunster)
- Date: 23 Dec 2002 23:21:50 -0500
On Mon, 2002-12-23 at 19:21, Stephen Touset wrote:
> I've been busy getting some music on gtk-gnutella, and it evidently
> renamed files to $(FILENAME).OK if it's good after completion, or
> $(FILENAME).BAD if it's corrupted.
> Which seems to be as it should. Anyone know what might be causing this?
Not really. But this one should do:
for file in *.OK; do mv "$file" "`echo $file | cut -d. -f1-3`" ; done
Pay attention though, the -f1-3 is because you have three .'s (dots) in
the filename. Adjust accordingly, or write a better script. :P
> Stephen Touset
-- Jordi
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale