소스 검색

Use seperate search and encode functions instead

master
= 3 년 전
부모
커밋
d0f61568eb
1개의 변경된 파일8개의 추가작업 그리고 9개의 파일을 삭제
  1. +8
    -9
      prompt

+ 8
- 9
prompt 파일 보기

@@ -78,23 +78,22 @@ both" |

ddg() {
search_string="$(printf "" | dmenu -p 'ddg')"
rawurlencode "$search_string"
}

rawurlencode() {
string_length=$(expr length $1)
string_length=$(expr length "$search_string")
char=''; new_string='';

i=1
while [ $i -le $string_length ]
do
char=$(expr substr $search_string $i 1)
new_string=$new_string$(rawurlencode $char)
printf "this is newstring %s\n" $new_string
char=$(expr substr "$search_string" $i 1)
new_string="$new_string$(rawurlencode "$char")"
# printf "this is newstring %s\n" "$new_string"
i=$(expr $i + 1)
done
printf "$newstring\n"
search="https://duckduckgo.com/?q=$new_string"
brave-browser "$search"
}

rawurlencode() {
case "$1" in
[-_.~a-zA-Z0-9] ) result=$1; printf $result;;
* ) result=$(printf '%%%02x' "'$1"); printf %$result;;


불러오는 중...
취소
저장