notes/scripts/repl
2023-08-24 16:46:33 -07:00

10 lines
No EOL
328 B
Bash
Executable file

#!/usr/bin/env bash
# Search and replace instances of first arg within current directory
# Ignores node_modules and dot directories
tobereplaced=$1
replacestring=$2
# Ignore dot directories
find . \( ! -regex '.*/\..*' \) -type f -not -path "./node_modules/*" -print0 | xargs -0 sed -i "s/${tobereplaced}/${replacestring}/gI"