Swap deprecated egrep for grep -E

also remove some extra whitespace in MD doc
This commit is contained in:
Martin Rys 2024-05-06 11:19:59 +02:00
parent f50c2af914
commit 7dc4d9bb71
2 changed files with 15 additions and 15 deletions

View file

@ -71,8 +71,8 @@ test -d ~/service || uberspace-setup-svscan
TEMPMDB="$(uberspace-setup-mongodb)"
MONGO_USER="${USER}_mongoadmin"
MONGO_PORT="$(echo ${TEMPMDB} | egrep -o 'm#:\s[0-9]{5}\sUs' | cut -d' ' -f 2)"
MONGO_PASS="$(echo ${TEMPMDB} | egrep -o 'rd:\s.+\sTo\sconn' | cut -d' ' -f 2)"
MONGO_PORT="$(echo ${TEMPMDB} | grep -E -o 'm#:\s[0-9]{5}\sUs' | cut -d' ' -f 2)"
MONGO_PASS="$(echo ${TEMPMDB} | grep -E -o 'rd:\s.+\sTo\sconn' | cut -d' ' -f 2)"
echo -e "MONGO_USER: ${MONGO_USER} \nMONGO_PORT: ${MONGO_PORT} \nMONGO_PASS: ${MONGO_PASS}"
@ -81,7 +81,7 @@ echo -e "MONGO_USER: ${MONGO_USER} \nMONGO_PORT: ${MONGO_PORT} \nMONGO_PASS: ${M
### Setup Websocket Port ###
############################
export FREE_PORT="$(uberspace-add-port --protocol tcp --firewall | egrep -o '[0-9]{5}')"
export FREE_PORT="$(uberspace-add-port --protocol tcp --firewall | grep -E -o '[0-9]{5}')"
echo "FREE_PORT: ${FREE_PORT}"

View file

@ -2,4 +2,4 @@
# Recursive find/replace.
# Syntax: ./find-replace.sh searchtext replacetext
egrep -lRZ '$1' . | xargs -0 -l sed -i -e 's/$1/$2/g'
grep -E -lRZ '$1' . | xargs -0 -l sed -i -e 's/$1/$2/g'