[SOLVED] How to make several "renames" by inoking a single command? Make a shell script file?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
foo=( ç á é í ó ú à è ì ò ù ä ë ï ö ü ÿ â ê î ô û å e i ø u )
bar=( c a e i o u a e i o u a e i o u y a e i o u a e i o u )
i=${#bar[@]}
while [ $i -gt 0 ]; do
i=$((i-1))
rename "s/${foo[$i]}/${bar[$i]}/g" "$@"
done
but this has resulted that when I invoke it on the terminal it just stays on an infinite loop, apparently, as it does nothing and then I have to do ^C to stop it and then I do ls and it is all the same.
I see, thankyou. But what I would really like is to invoke a command and have it check all filenames and directory names in the directory where I am at. And change them accordingly, if needed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.