From fec76615ba18f402f932c1762d0d45473567b9d7 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 6 Feb 2024 17:18:37 +0100 Subject: [PATCH] RETRO ENGINEERING AND CODE SNIFFING TOOLS --- search | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/search b/search index 26cfc2e9..7174d970 100755 --- a/search +++ b/search @@ -1,16 +1,21 @@ #!/bin/bash +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" +## THIS IS A GREAT RETRO ENGINEERING AND CODE SNIFFING TOOLS clear +[[ ! -s ~/.local/bin/${ME} ]] && cp ${MY_PATH}/${ME} ~/.local/bin/ && echo "Auto Install into ~/.local/bin/${ME}" echo "------------------------------------------------------------------------------" if [ "$1" == "" ]; then - echo " Nothing to search for!" + echo " Nothing to search for!" else - echo " Searching for "$1" recursively. Please Wait..." - echo "------------------------------------------------------------------------------" - grep -h -r --exclude-dir='.git*' --exclude='twuplanet.html' --exclude='twsector.html' -H --colour=always "$1" ./ + echo " Searching for "$1" recursively. Please Wait..." + echo "------------------------------------------------------------------------------" + grep -h -r --exclude-dir='.git*' --exclude='twuplanet.html' --exclude='twsector.html' -H --colour=always "$1" ./ fi echo "------------------------------------------------------------------------------" if [ "$2" != "" ]; then - echo " To replace \"$1\" whith \"$2\", please run" - echo " grep -rl --exclude-dir='.git*' --exclude='twuplanet.html' --exclude='twsector.html' '$1' ./ | xargs sed -i 's~$1~$2~g'" + echo " To replace \"$1\" whith \"$2\", please run" + echo " grep -rl --exclude-dir='.git*' --exclude='twuplanet.html' --exclude='twsector.html' '$1' ./ | xargs sed -i 's~$1~$2~g'" fi -## THIS IS A GREAT RETRO ENGINEERING AND CODING TOOLS +exit 0