Add ability to read search string from stdin
authorSiraaj Khandkar <siraaj@khandkar.net>
Tue, 11 Jan 2022 18:16:18 +0000 (13:16 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Tue, 11 Jan 2022 18:16:18 +0000 (13:16 -0500)
home/lib/login_functions.sh

index ae4e98e..3ea0e1d 100644 (file)
@@ -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() {
This page took 0.036089 seconds and 4 git commands to generate.