Astroport.ONE/search

17 lines
767 B
Plaintext
Raw Normal View History

#!/bin/bash
clear
echo "------------------------------------------------------------------------------"
if [ "$1" == "" ]; then
echo " Nothing to search for!"
else
echo " Searching for "$1" recursively. Please Wait..."
echo "------------------------------------------------------------------------------"
2023-11-27 20:40:46 +01:00
grep -h -r --exclude-dir='.git*' --exclude='minimal.html' --exclude='empty.html' -H --colour=always "$1" ./
fi
echo "------------------------------------------------------------------------------"
if [ "$2" != "" ]; then
echo " To replace \"$1\" whith \"$2\", please run"
2023-11-27 20:40:46 +01:00
echo " grep -rl --exclude-dir='.git*' --exclude='minimal.html' --exclude='empty.html' '$1' ./ | xargs sed -i 's~$1~$2~g'"
fi
## THIS IS A GREAT RETRO ENGINEERING AND CODING TOOLS