How to rename multiple files by replacing word in file name geting from the shell script variables?
- by fy6877
This question like this thread.
How to rename multiple files by replacing word in file name?
My example is more complex than the above topic.
The two variables are $name and $ newname getting from the shell script other location.
$name and $ newname may have the unicode words or special symbles like []<?...etc,so could anyone help me to provide a method to add a part of script in shell scrit to solve file name replacing question.
BTW,I try to type two kind of commands to change the part of file name, but it can't work.
rename.ul '$name' '$newname' /home/fy6877/test/final/*
ls /home/fy6877/test/final/|xargs -I$ rename.ul '$name' '$newname' $