This commit is contained in:
6
conv1to2
6
conv1to2
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user