Re: regex help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On my end, I'd probably do something like.

rename.ul "." " " *.txt
repeat until all periods are gone.
rename.ul "  " " " *txt
repeat until double spaces are gone.
rename.ul " txt" ".txt" *txt

to restore the dots before the extention...

Admittedly, this is a bit clunky, and assumes the only dots you want
to keep are the ones before the extentions... Also, I'm running an old
version of util-linux because newer versions either drop rename.ul in
favor of making people use Perl's rename package or changed the syntax
in a way I found harder to use...

So while we're on the subject of renaming stuff, can anyone suggest a
more current rename utility where doing a simple search and replace on
all files in the working directory is as simple as:

command "string to replace" "string to replace with" *

perhaps with replace  all instances in a filename instead of just the
first as default or a simple dash single letter option?

I don't doubt the power of perl rename, but the last time I tried it,
something as simple as replace one string literal with another string
literal was more complicated than I was comfortable with and those
account for the majority of cases where I want to batch rename stuff.

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/blinux-list




[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]