|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
hi there.. i just want to create a script that iwll rename file.
when am renaming if the file has any capital letter it should change it to small letter. ex: rename aBcd NN9x.Z -the rename is the name of the script file..it will rename the aBcd to abcd and NN9x.Z to nn9x.z .. how do u do this.. ..let me konw please. thank you very much. |
|
#2
|
|||
|
|||
|
Code:
mv $file `echo $file| tr -s '[:upper:]' '[:lower:]' ` tr changes the case. mv renames the file. |
|
#3
|
|||
|
|||
|
jim it's dangerous....
newname=`echo $file| tr -s '[:upper:]' '[:lower:]'` this is OK ... [ -f $newname ] && echo $newname still exists && continue mv $file $newname ... |
|
#4
|
|||
|
|||
|
What you mean is that it will clobber existing files - correct.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > rename a file... how??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|