This commit is contained in:
q
2012-11-13 19:56:54 +02:00
parent 4865933d81
commit eaf85b0bad

View File

@@ -2,15 +2,15 @@
IFS=$'\n' IFS=$'\n'
if [ -z "$1" ] if [ -z "$1" ]
then echo give two strings then echo rename files in current folder replacing arg1 with arg2.
exit exit
fi fi
for file in $( ls | grep "$1" ) for file in $( ls | grep "$1" )
do mv -iv "$file" "$( echo $file | sed s/"$1"/"$2"/g )" do echo "$file" '->' "$( echo $file | sed s/"$1"/"$2"/g )"
done done
echo 'sure?' echo 'sure?'
read i read i
for file in $( ls | grep "$1" ) for file in $( ls | grep "$1" )
do echo mv -iv "$file" "$( echo $file | sed s/"$1"/"$2"/g )" do mv -iv "$file" "$( echo $file | sed s/"$1"/"$2"/g )"
done done