From 56b5d8cf0df6d56c19d7b510748429da19137335 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Tue, 11 Jan 2022 13:16:18 -0500 Subject: [PATCH] Add ability to read search string from stdin --- home/lib/login_functions.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index ae4e98e..3ea0e1d 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -2,7 +2,19 @@ ## ws: web search ws() { - firefox --search "$*" + local line search_string0 search_string + + search_string0="$*" + case "$search_string0" in + '') + while read -r line; do + search_string="${search_string} ${line}" + done;; + *) + search_string="$search_string0";; + esac + + firefox --search "$search_string" } d() { -- 2.20.1