Added search/replace script

This commit is contained in:
z3rOR0ne 2023-08-24 16:46:33 -07:00
parent 03b315b635
commit 9252c7622b

10
scripts/repl Executable file
View file

@ -0,0 +1,10 @@
#!/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"