blokator/replace-string.sh

14 lines
267 B
Bash
Executable file

#!/usr/bin/env bash
# Usage:
# ./replace-string.sh.sh <from> <to>
if [ "$1" == "" ] || [ "$2" == "" ]
then
echo "error: Not enough arguments."
echo "usage: ./replace-string.sh <from> <to>"
exit
fi
find ./ -iname "*.rs" -type f -exec sed -i "s/$1/$2/g" {} \;