diff --git a/searchsploit b/searchsploit index c4ee29507..bea9ed1b7 100755 --- a/searchsploit +++ b/searchsploit @@ -191,12 +191,12 @@ done ## Print the full path. If pbcopy/xclip is available then copy to the clipboard -if [[ "${GETPATH}" -eq '1' ]]; then +if [[ "${GETPATH}" -eq 1 ]]; then ## Get EDB-ID from input edbdb="$( echo ${TAGS} | tr -dc '0-9' )" ## Check files.csv - location=$(cut -d, -f2 "${csvpath}" | grep -m 1 -E "/${edbdb}(\..*)?$") - title=$(grep -m 1 "${location}" "${csvpath}" | cut -d, -f3) + location=$( cut -d, -f2 "${csvpath}" | grep -m 1 -E "/${edbdb}(\..*)?$" ) + title=$( grep -m 1 "${location}" "${csvpath}" | cut -d, -f3 ) ## Join paths location="${gitpath}/${location}" @@ -250,7 +250,7 @@ fi if [[ "${WEBLINK}" -eq 1 ]]; then COL2=45 else - COL2=35 + COL2=$(( ${#gitpath} + 15 )) fi COL1=$(( $( tput cols ) - COL2 - 1 )) @@ -292,7 +292,10 @@ else for tag in ${TAGS}; do ## If we are to use colour, add the values to search for between "or" if [[ "${COLOUR}" -eq 1 ]]; then - COLOUR_TAG="${COLOUR_TAG}\|${tag}" + if [[ "${COLOUR_TAG}" ]]; then + COLOUR_TAG="${COLOUR_TAG}\|" + fi + COLOUR_TAG="${COLOUR_TAG}${tag}" fi ## Search both title and path? @@ -313,7 +316,7 @@ else ## Case sensitive? if [[ "${SCASE}" -eq 1 ]]; then - EARCH="${SEARCH}${tag}" + SEARCH="${SEARCH}${tag}" else SEARCH="${SEARCH}$( echo ${tag} | tr '[:upper:]' '[:lower:]' )" fi